Leetcode 1603 Solution
This article provides solution to leetcode question 1603 (running-sum-of-1d-array)
Access this page by simply typing in "lcs 1603" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
https://leetcode.com/problems/running-sum-of-1d-array
Solution
class Solution:
def runningSum(self, nums: List[int]) -> List[int]:
ans = []
s = 0
for num in nums:
s += num
ans.append(s)
return ans