MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / Solution

Class Solution

LeetCode_problems/Running Sum of 1d Array/solution.py:1–10  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1class Solution:
2 def runningSum(self, nums: List[int]) -> List[int]:
3 # declare array to return
4 output = list()
5
6 # compute running sum for each index
7 for i in range(len(nums)):
8 output.append(sum(nums[:i+1]))
9
10 return output

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected