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