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