Given an array of distinct integers, return all permutations. Order matters — [1,2,3] and [3,2,1] are different.
Backtracking: at each position, try every unused number. n! total permutations.
💡 Pro tip: Understand this problem deeply — don't just memorize the code. Try explaining the approach out loud as if teaching a friend. If you can explain it simply, you truly understand it!
len(permute([1, 2, 3]))
6