Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 알고리즘풀기
- 코틀린기초
- python priority queue
- python 릿코드
- 파이썬 프로그래머스
- LeetCode
- 잇츠디모
- 릿코드
- 파이썬릿코드
- 릿코드풀기
- 파이썬알고리즘
- 파이썬 릿코드
- python Leetcode
- python 알고리즘
- 상가수익률계산기
- 릿코드 파이썬
- 파이썬릿코드풀기
- binary search
- 파이썬 알고리즘
- 알고리즘풀이
- python xor
- python sorted
- leetcode 풀기
- 릿코드풀이
- python zip_longest
- leetcode풀기
- 파이썬알고리즘풀기
- 파이썬 알고리즘 풀기
- 릿코드 풀기
- leetcode풀이
Archives
- Today
- Total
목록python 누적합 계산 (1)
소프트웨어에 대한 모든 것

Running Sum of 1d Array 문제) 솔루션1) class Solution: def runningSum(self, nums: List[int]) -> List[int]: ret = [nums[0]] for i in range(1, len(nums)): ret.append(ret[i-1] + nums[i]) return ret 솔루션2) from itertools import accumulate class Solution: def runningSum(self, nums: List[int]) -> List[int]: return list(accumulate(nums)) 힌트) itertools.accumulate() 함수는 누적합을 계산
알고리즘/LeetCode
2021. 10. 16. 15:51