Permutations

Backtracking · Choose an unused option at each depth · Stretch · about 26 min

Why it matters

This makes the decision-tree shape visible before harder search problems.

How it connects

Subsets chose include/skip by index. Permutations choose one unused value for each position.

Try first

What must be true when your current path has the same length as nums?

Interview cue

The path records the partial arrangement, and the used set prevents duplicates within it.