๋ชฉ์ฐจ
LeetCode - Problems - Algorithms - 1480. Running Sum of 1d Array
Problem Description
Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]...nums[i]).
Return the running sum of nums.
Examples:

Constraints:
- 1 <= nums.length <= 1000
- -10^6 <= nums[i] <= 10^6
My Solution (Python)
class Solution:
def runningSum(self, nums):
answer = []
current_sum = 0
for x in nums:
current_sum += x
answer.append(current_sum)
return answer'Problem solving > Algorithms' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| [LeetCode] 1431. Kids With the Greatest Number of Candies (Python) (0) | 2021.01.09 |
|---|---|
| [LeetCode] 1672. Richest Customer Wealth (Python) (0) | 2021.01.09 |
| An array of divisible numbers (๋๋์ด ๋จ์ด์ง๋ ์ซ์ ๋ฐฐ์ด) (0) | 2020.09.10 |
| Finding prime numbers (์์ ์ฐพ๊ธฐ) (0) | 2020.08.28 |
| Sum between two integers (๋ ์ ์ ์ฌ์ด์ ํฉ) (0) | 2020.08.28 |