diff --git a/LeetCode/1480_Running_Sum_of_1d_array.py b/LeetCode/1480_Running_Sum_of_1d_array.py new file mode 100644 index 0000000..1cc9a3f --- /dev/null +++ b/LeetCode/1480_Running_Sum_of_1d_array.py @@ -0,0 +1,7 @@ +class Solution: + def runningSum(self, nums: List[int]) -> List[int]: + ans = [] + ans.append(nums[0]) + for i in range(1, len(nums)): + ans.append(ans[i-1] + nums[i]) + return ans \ No newline at end of file