일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 시바견
- Decorator
- 43. Multiply Strings
- concurrency
- LeetCode
- 컴퓨터의 구조
- t1
- 프로그래머스
- Protocol
- 파이썬
- 운영체제
- 715. Range Module
- kaggle
- 30. Substring with Concatenation of All Words
- iterator
- Python Implementation
- data science
- Class
- shiba
- Regular Expression
- Generator
- 315. Count of Smaller Numbers After Self
- attribute
- 109. Convert Sorted List to Binary Search Tree
- Convert Sorted List to Binary Search Tree
- DWG
- Python
- 밴픽
- Substring with Concatenation of All Words
- Python Code
Archives
- Today
- Total
목록77. Combinations (1)
Scribbling
LeetCode: 77. Combinations
class Solution: def combine(self, n: int, k: int) -> List[List[int]]: self.ret = [] self.helper([i+1 for i in range(n)], k, []) return self.ret def helper(self, nums, k, path): if k == 0: self.ret.append(path) return for i, num in enumerate(nums): self.helper(nums[i+1:], k-1, path+[num])
Computer Science/Coding Test
2021. 9. 28. 22:01