Easy Problems

1480. Running Sum of 1d Array

Solutions

function runningSum(nums: number[]): number[] {
  for (let i = 1; i < nums.length; i++) {
      nums[i] = nums[i - 1] + nums[i];
  }
  return nums;
};
Last Update: 12:08 - 16 April 2024
Array
Prefix Sum

On this page