# 46 - Permutations
解法一 - Backtracking
這題應該算是 backtracking 的經典題,終止條件是 tmp 的長度跟 nums 一樣(表示所有數字都有列舉到),直接上程式碼:
Runtime: 8 ms, faster than 98.53% of C++ online submissions for Permutations. Memory Usage: 9.2 MB, less than 90.03% of C++ online submissions for Permutations.
Last updated
Was this helpful?