LeetCode solutions

1603. Running Sum of 1d Array

My accepted Python solution to LeetCode problem 1603, Running Sum of 1d Array, running in 0ms.

  • Difficulty: Easy
  • Python
  • Runtime 0ms
  • Memory 12.5MB

Read the problem on LeetCode View on GitHub

Python

Accepted on LeetCode — runtime 0ms, memory 12.5MB, accepted 2025-12-24.

python
class Solution(object):
    def runningSum(self, nums):
        for i in range(1, len(nums)):
            nums[i] += nums[i-1]
        return nums

Source