1480. Running Sum of 1d Array
🟩 Easy
Solution
My Solution
func runningSum(nums []int) []int {
for i:=1; i<len(nums); i++ {
nums[i] += nums[i-1]
}
return nums
}

Leetcode: link
Last updated
Was this helpful?
🟩 Easy
My Solution
func runningSum(nums []int) []int {
for i:=1; i<len(nums); i++ {
nums[i] += nums[i-1]
}
return nums
}
Leetcode: link
Last updated
Was this helpful?