Skip to content

Commit ee863fd

Browse files
committed
Time: 179 ms (53.37%), Space: 41.5 MB (78.55%) - LeetHub
1 parent 06ba6d8 commit ee863fd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
public class Solution {
2+
public int[] RunningSum(int[] nums)
3+
{
4+
var res = new int[nums.Length];
5+
res[0] = nums[0];
6+
7+
for (var i = 1; i < nums.Length; i++)
8+
{
9+
res[i] = nums[i] + res[i - 1];
10+
}
11+
12+
return res;
13+
}
14+
}

0 commit comments

Comments
 (0)