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