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