📅  最后修改于: 2022-03-11 14:52:19.541000             🧑  作者: Mango
class Solution {
public int[] runningSum(int[] nums) {
int[] ans = new int[nums.length];
ans[0] = nums[0];
for (int i = 1; i < nums.length; i++)
ans[i] = ans[i-1] + nums[i];
return ans;
}
}