Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Git
- 금융문자분석경진대회
- dacon
- 코로나19
- programmers
- SW Expert Academy
- 파이썬
- 프로그래머스 파이썬
- 데이콘
- 우분투
- 백준
- AI 경진대회
- gs25
- 편스토랑 우승상품
- leetcode
- hackerrank
- ChatGPT
- 자연어처리
- 캐치카페
- github
- Real or Not? NLP with Disaster Tweets
- Docker
- PYTHON
- 편스토랑
- ubuntu
- 더현대서울 맛집
- Kaggle
- 프로그래머스
- Baekjoon
- 맥북
Archives
- Today
- Total
솜씨좋은장씨
[leetCode] 46. Permutations (Python) 본문
728x90
반응형

Given a collection of distinct integers, return all possible permutations.
Example:
Input: [1,2,3]
Output:
[
[1,2,3],
[1,3,2],
[2,1,3],
[2,3,1],
[3,1,2],
[3,2,1]
]
Solution
from itertools import permutations
class Solution:
def permute(self, nums: List[int]) -> List[List[int]]:
permu = list(permutations(nums, len(nums)))
return permu



SOMJANG/CODINGTEST_PRACTICE
1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub.
github.com
'Programming > 코딩 1일 1문제' 카테고리의 다른 글
[leetCode] 204. Count Primes (Python) (0) | 2020.06.06 |
---|---|
[leetCode] 29. Divide Two Integers (Python) (2) | 2020.06.05 |
[leetCode] 75. Sort Colors (Python) (2) | 2020.06.03 |
[leetCode] 50. Pow(x, n) (Python) (0) | 2020.06.02 |
[BaeKJoon] 9461번: 파도반 수열 (Python) (0) | 2020.06.01 |