class Solution:
def runningSum(self, nums: List[int]) -> List[int]:
if nums is None or len(nums) == 0:
return nums
for i in range(1, len(nums)):
nums[i] += nums[i-1]
return nums
# def runningSum(self, nums: List[int]) -> List[int]:
# # accumulate method
# return accumulate(nums)
Download Running Sum of 1d Array.pyLeetcode 1480 Running Sum of 1d Array problem solution in python3 with explanation. This is the best place to expand your knowledge and get prepared for your next interview.
Feedback is the most important part of any website.
If you have any query, suggestion or feedback, Please feel free to contact us.