일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 컴퓨터의 구조
- LeetCode
- 43. Multiply Strings
- 밴픽
- Generator
- attribute
- 315. Count of Smaller Numbers After Self
- Protocol
- Convert Sorted List to Binary Search Tree
- shiba
- Regular Expression
- Python Code
- 프로그래머스
- 운영체제
- t1
- Class
- 파이썬
- 30. Substring with Concatenation of All Words
- Substring with Concatenation of All Words
- Python Implementation
- Decorator
- kaggle
- data science
- Python
- 715. Range Module
- DWG
- 시바견
- concurrency
- iterator
- 109. Convert Sorted List to Binary Search Tree
Archives
- Today
- Total
Scribbling
LeetCode: 78. Subsets 본문
class Solution:
def subsets(self, nums: List[int]) -> List[List[int]]:
self.ret = []
self.helper(nums, [])
return self.ret
def helper(self, nums, path):
self.ret.append(path)
if not nums:
return
for i, num in enumerate(nums):
self.helper(nums[i+1:], path+[num])
'Computer Science > Coding Test' 카테고리의 다른 글
LeetCode: 85. Maximal Rectangle (0) | 2021.10.04 |
---|---|
LeetCode: 79. Word Search (0) | 2021.10.01 |
LeetCode: 76. Minimum Window Substring (0) | 2021.09.30 |
LeetCode: 77. Combinations (0) | 2021.09.28 |
LeetCode: 75. Sort Colors (0) | 2021.09.28 |