Skip to content

Commit c3144f9

Browse files
committed
Runtime 36 ms (Top 89.21%) | Memory 14.0 MB (Top 62.65%)
1 parent e18ac49 commit c3144f9

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
class Solution:
2-
def runningSum(self, nums: List[int]) -> List[int]:
3-
output, add = [], 0
4-
for num in nums:
5-
add += num
6-
output.append(add)
7-
return output
2+
def runningSum(self, nums):
3+
a=0
4+
list=[]
5+
for i in nums:
6+
a=i+a
7+
list.append(a)
8+
return(list)

0 commit comments

Comments
 (0)