Skip to content

Commit 5837348

Browse files
committed
added code source
1 parent 5a2ab54 commit 5837348

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Running Sum of 1d Array/code.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* @param {number[]} nums
3+
* @return {number[]}
4+
*/
5+
var runningSum = function(nums) {
6+
var tab =[];
7+
8+
tab[0]=nums[0];
9+
for(let i=1; i<nums.length;i++){
10+
tab[i]= tab[i-1]+nums[i];
11+
}
12+
return tab;
13+
14+
};

0 commit comments

Comments
 (0)