1
class Solution:
2
def runningSum(self, nums: List[int]) -> List[int]:
3
# The variable that will have the running sum
4
tot = 0
5
# The array that will hold the running su,
6
ans = []
7
# For loop
8
for ele in nums:
9
# Adding the element
10
tot += ele
11
# Appending this running sum to ans
12
ans.append(tot)
13
# Return ans
14
return ans

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0