Given an array nums, return the running sum where result[i] equals the sum of nums[0] through nums[i].
With nums = [1, 2, 3, 4], the answer is [1, 3, 6, 10]. The first element stays 1. The second is 1 + 2 = 3. The third is 1 + 2 + 3 = 6. The fourth is 1 + 2 + 3 + 4 = 10.
This is the foundation of prefix sums. How can you compute this efficiently in a single pass?
Constraints: , values from to .