mirror of
https://github.com/devenperez/leetcode.git
synced 2026-06-13 03:27:07 +00:00
Time: 57 ms (16.14%), Space: 13.6 MB (61.59%) - LeetHub
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
class Solution(object):
|
||||
def runningSum(self, nums):
|
||||
"""
|
||||
:type nums: List[int]
|
||||
:rtype: List[int]
|
||||
"""
|
||||
sum = [nums[0]]
|
||||
for i in range(1, len(nums)):
|
||||
sum.append(sum[i-1] + nums[i])
|
||||
return sum
|
||||
Reference in New Issue
Block a user