Skip to content

Instantly share code, notes, and snippets.

@vrat28
Last active May 3, 2021 08:40
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save vrat28/bfb51cfb9dc1df941f5861eff9ae0cad to your computer and use it in GitHub Desktop.
Running Sum
class Solution {
func runningSum(_ nums: [Int]) -> [Int] {
var nums = nums
for i in 1..<nums.count {
nums[i] = nums[i - 1] + nums[i]
}
return nums
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment