---
# System prepended metadata

title: '[1480. Running Sum of 1d Array](https://leetcode.com/problems/running-sum-of-1d-array/)'

---

# [1480. Running Sum of 1d Array](https://leetcode.com/problems/running-sum-of-1d-array/)
![](https://i.imgur.com/WyQmGYp.png)
![](https://i.imgur.com/YxO7CQ3.png)
/**
 * Note: The returned array must be malloced, assume caller calls free().
 */
int* runningSum(int* nums, int numsSize, int* returnSize){
    returnSize[0]=nums[0];
    for(int i=1;i<numsSize;i++)
    {
        nums[i]+=nums[i-1];
    }
    *returnSize = numsSize;
    return nums;
}