Running Sum of 1d Array Problem
Running Sum of 1d Array Problem — ExecCode School DSA Practice
Solve the Running Sum of 1d Array problem on ExecCode. Free online school DSA practice in Arrays - Basics. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Given an array nums, return the running sum array where output[i] equals the sum of nums[0] through nums[i] inclusive, for every index i.
Examples
Input nums = [3, 1, 4, 1, 5, 9, 2, 6]; Output [3, 4, 8, 9, 14, 23, 25, 31]. Input nums = [1, 2, 3, 4]; Output [1, 3, 6, 10]. Input nums = [1, 1, 1, 1, 1]; Output [1, 2, 3, 4, 5]
Constraints
1 ≤ nums.length ≤ 1000 -10⁶ ≤ nums[i] ≤ 10⁶
Practice Running Sum of 1d Array free on ExecCode. Browse DSA problems, topic map, and placement guides.