We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 513461b commit dd389e0Copy full SHA for dd389e0
1480. Running Sum of 1d Array
@@ -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