There was an error while loading. Please reload this page.
2 parents 16d3094 + 8feaafa commit 4c5e2a1Copy full SHA for 4c5e2a1
LeetCode/1480_Running_Sum_of_1d_array.py
@@ -0,0 +1,7 @@
1
+class Solution:
2
+ def runningSum(self, nums: List[int]) -> List[int]:
3
+ ans = []
4
+ ans.append(nums[0])
5
+ for i in range(1, len(nums)):
6
+ ans.append(ans[i-1] + nums[i])
7
+ return ans
0 commit comments