AIRSATM / My-progress

0 stars 0 forks source link

Running Sum of 1d Array #3

Open AIRSATM opened 4 hours ago

AIRSATM commented 4 hours ago

class Solution { public: vector runningSum(vector& nums) { for(int i=1; i<nums.size(); i++){ // we started with 1st index, so 0 index is not reading nums[i] += nums[i-1]; } return nums; } }; //next we know how write a code in int main ^3^