문제 링크 : https://leetcode.com/problems/permutations/
해설쓰는것도 조금 민망할만큼 쉬운 문제이다...
class Solution:
def permute(self, nums: List[int]) -> List[List[int]]:
from itertools import permutations
return list(permutations(nums, len(nums)))
파이썬 내부의 permutations를 이용하면 쉽게 풀 수 있다.
아마 내부 함수를 활용하지 않고 for문을 이용하여 직접 조합하는 방법도 있을것이다.....