package leetcode;

import java.util.Arrays;

/**
 * https://leetcode.com/problems/running-sum-of-1d-array/
 */
public class Problem1480 {
    public int[] runningSum(int[] nums) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem1480 prob = new Problem1480();
        System.out.println(Arrays.toString(prob.runningSum(new int[]{1,2,3,4}))); // [1,3,6,10]
        System.out.println(Arrays.toString(prob.runningSum(new int[]{1,1,1,1,1}))); // [1,2,3,4,5]
        System.out.println(Arrays.toString(prob.runningSum(new int[]{3,1,2,10,1}))); // [3,4,6,16,17]
    }
}

@@ -185,431 +185,203 @@
     
-// TODO%0A        return null
+int%5B%5D answer = new int%5Bnums.length%5D
 ;%0A    
-%7D%0A%0A
     
-public static void main(String%5B%5D args) %7B%0A        Problem1480 prob = new Problem1480();%0A        System.out.println(Arrays.toString(prob.runningSum(new int%5B%5D%7B1,2,3,4%7D))); // %5B1,3,6,10%5D%0A        System.out.println(Arrays.toString(prob.runningSum(new int%5B%5D%7B1,1,1,1,1%7D))); // %5B1,2,3,4,5%5D%0A        System.out.println(Arrays.toString(prob.runningSum(new int%5B%5D%7B3,1,2,10,1%7D))); // %5B3,4,6,16,17%5D
+int sum = 0;%0A        for (int i = 0; i %3C nums.length; i++) %7B%0A            sum += nums%5Bi%5D;%0A            answer%5Bi%5D = sum;%0A        %7D%0A        return answer;
 %0A   

Solve problem 1480