Leetcode 5453. Running Sum of 1d Array

Pierre-Marie Poitevin
2 min readJun 14, 2020

In this Leetcode problem, we are asked to return the sum array given an nums array where sum[i] = sum(nums[0],…, nums[i])

Problem statement

Solution

A few ideas for this problem:

  1. We will use the input array and modify it, and return it as the solution. That way, we don’t have to create a new array.
  2. We will build a loop such that…

--

--