Each position stores the cumulative sum of all elements up to and including that index.
Use the recurrence: result[i] = result[i-1] + nums[i]. You don't need to re-sum from the beginning each time. Just add the current element to the previous running sum.
You can do this in-place by modifying the original array, or create a new array if you need to preserve the input.
With nums = [1, 2, 3, 4]: start with [1, _, _, _]. Then [1, 3, _, _]. Then [1, 3, 6, _]. Finally [1, 3, 6, 10].