Running Sum of 1d Array

给一个数组求,pre sum数组.

class Solution {
    public int[] runningSum(int[] nums) {
        int cur = 0;
        for(int i = 0; i < nums.length; i++) {
            cur += nums[i];
            nums[i] = cur;
        }
        return nums;
    }
}