Running Sum of 1D Array Problem & Solution

See the running sum of 1d array problem on LeetCode.

C++ Solution

class Solution {
public:
  vector<int> runningSum(vector<int>& nums) {
    for (int i = 1; i < nums.size(); ++i) {
      nums[i] += nums[i - 1];
    }

    return nums;
  }
};

Start Here

Many paths, there are. Follow yours, you must.