Created
December 3, 2020 21:13
-
-
Save kingsamadesu/d45c2195886b623cb9043c7b1b6664a9 to your computer and use it in GitHub Desktop.
1480. Running Sum of 1d Array -with java- (leetcode.com)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Your runtime beats 100.00 % of java submissions. | |
Your memory usage beats 91.56 % of java submissions. | |
*/ | |
class Solution { | |
public int[] runningSum(int[] nums) { | |
for(int i = 1 ; i < nums.length ; i++){ | |
nums[i]+=nums[i-1]; | |
} | |
return nums; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment