Created
January 15, 2024 04:31
-
-
Save praveeng1618/298716654296c46cc435b04ebe2d525b to your computer and use it in GitHub Desktop.
1480. Running Sum of 1d Array Leetcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution: | |
def runningSum(self, nums: List[int]) -> List[int]: | |
Sum = 0 | |
for i in range(0,len(nums)): | |
Sum = Sum + nums[i] | |
nums[i] = Sum | |
return nums |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment