일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Regular Expression
- Python Code
- data science
- Substring with Concatenation of All Words
- Class
- LeetCode
- t1
- iterator
- Python Implementation
- 컴퓨터의 구조
- 315. Count of Smaller Numbers After Self
- 109. Convert Sorted List to Binary Search Tree
- Generator
- concurrency
- 715. Range Module
- kaggle
- Protocol
- attribute
- Convert Sorted List to Binary Search Tree
- DWG
- 43. Multiply Strings
- Python
- 시바견
- shiba
- 프로그래머스
- 30. Substring with Concatenation of All Words
- 밴픽
- 파이썬
- 운영체제
- Decorator
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