Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java running sum

    public int[] runningSum(int[] nums) {
        
        int len = nums.length;
        
        for(int i = 1; i < len; i++){
            nums[i] += nums[i-1];
        }
        return nums;
    }
 
PREVIOUS NEXT
Tagged: #java #running #sum
ADD COMMENT
Topic
Name
1+6 =