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