[LeetCode] Permutations
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] ] 먼저 순열을 어떻게 구할 지 방법을 선택해야 합니다. 저는 재귀적인 방법을 선택해서 문제를 풀었습니다. start = 0 start = 1 start = 2 [1, 2, 3] [1, 2, 3] [1, 2, 3] [1, 3, 2] [1, 3, 2] [2, 1, 3] [2, 1, 3] [2, 1, 3] [2, 3, 1] [2, 3, 1] [3, 2, 1] [3, 2, 1] [3, 2, 1] [3, 1, 2] [3, 1,..
2019. 12. 23. 19:29