-
LeetCode - 46. Permutation알고리즘/알고리즘 문제 복기 2021. 3. 29. 08:32
leetcode.com/problems/permutations/
Permutations - LeetCode
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
Answer
이번에도 백트레킹 문제
Permutation의 조합을 전부 구하는 문제였다.
used로 이미 사용한 수를 체크하여 백트래킹 시켜 풀어냈다.
아니면 다음과 같이 현재 남은 수를 체킹하여 풀어낼 수도 있다.
Reference
www.youtube.com/watch?v=idmgLLNIC2U
www.youtube.com/watch?v=KukNnoN-SoY
'알고리즘 > 알고리즘 문제 복기' 카테고리의 다른 글
LeetCode - 49.Group Anagram (0) 2021.04.01 Leet Code - 48. Rotate Image (0) 2021.03.30 Leet code - 55. Jump Game (0) 2021.03.26 Leet Code - 45. Jump Game II (0) 2021.03.26 LeetCode 39. - Combination Sum (0) 2021.03.24