All Problems

Running Sum of 1d Array

EasyarrayExpected: O(n) time, O(n) spaceInterview Context
prefix-sum

Problem

Given an array nums, return an array where each element at index i is the sum of all elements from index 0 to i.

Loading...