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