일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 715. Range Module
- Class
- 운영체제
- 109. Convert Sorted List to Binary Search Tree
- 파이썬
- Generator
- Protocol
- 315. Count of Smaller Numbers After Self
- 43. Multiply Strings
- Convert Sorted List to Binary Search Tree
- Decorator
- Python Implementation
- shiba
- t1
- Substring with Concatenation of All Words
- Python Code
- data science
- 컴퓨터의 구조
- 시바견
- Regular Expression
- 밴픽
- 프로그래머스
- concurrency
- kaggle
- DWG
- Python
- LeetCode
- iterator
- 30. Substring with Concatenation of All Words
- attribute
Archives
- Today
- Total
목록39. Combination Sum (1)
Scribbling
39. Combination Sum
class Solution: def combinationSum(self, candidates: List[int], target: int) -> List[List[int]]: ret = [] arr = [0] self.helper(ret, arr, candidates, target) return ret def helper(self, ret, arr, candidates, target): _sum = sum(arr) if _sum > target: return if _sum == target: ret.append(arr[1:]) return for candidate in candidates: last_input = arr[-1] if candidate >= last_input: next_arr = arr.c..
Computer Science/Coding Test
2021. 9. 4. 19:31