LeetCode Problem - Link
A pretty straightforward approach for solving this, we add the adjacent numbers in an array and return the final resultant array
Sequential Approach
/** * @param {number[]} nums * @return {number[]} */ var runningSum = function(nums) { // We can skip the first element as it doesn't participate yet for(var i=1;i<nums.length;i++){ nums[i] += nums[i-1] } return nums };