Given an array of distinct integers, return all possible permutations.
With [1, 2, 3], return all 6 permutations:
[[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]].
A permutation uses every element exactly once. The order matters.
This is a foundational backtracking problem. How do you systematically generate all orderings?
Constraints: length . All elements distinct.