Subsets

Backtracking · Choose, explore, unchoose · Stretch · about 22 min

Why it matters

Backtracking is a repeatable template, not a mysterious category.

How it connects

Instead of one greedy choice, explore both choices while keeping your current path honest.

Try first

For each number, say the only two choices you have. Draw the decision tree for [1, 2].

Interview cue

I make a choice, recurse, and undo that choice so sibling branches stay independent.