Given an array nums, return a new array result where result[i] = sum(nums[0] + nums[1] + ... + nums[i]) — the running (prefix) sum at each index.
Input: An integer array nums of length n.
Output: Integer array of length n — the running sum.
Input: [1,2,3,4]
Output: [1,3,6,10]
Explanation: result[0]=1, result[1]=1+2=3, result[2]=1+2+3=6, result[3]=1+2+3+4=10.Input: [1,1,1,1,1]
Output: [1,2,3,4,5]
Explanation: Each step adds 1. Result = [1,2,3,4,5].Input: [3,1,2,10,1]
Output: [3,4,6,16,17]
Explanation: 3, 3+1=4, 4+2=6, 6+10=16, 16+1=17.1 <= nums.length <= 1000-10^6 <= nums[i] <= 10^6