Skip to content

Commit dd389e0

Browse files
authored
Create 1480. Running Sum of 1d Array
1 parent 513461b commit dd389e0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

1480. Running Sum of 1d Array

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution {
2+
public:
3+
vector<int> runningSum(vector<int>& nums) {
4+
int ans=0;
5+
for(int i=0; i<nums.size(); i++){
6+
ans=ans+nums[i];
7+
nums[i]=ans;
8+
}
9+
return nums;
10+
}
11+
};

0 commit comments

Comments
 (0)