๐ฎ Backtracking (Practice)
Companion to the Backtracking guide. See how the number of subsets doubles per element, then generate them all.
๐ฌ Watch it workโ
Subsets โ the power set doubles each stepStep 1 / 5
Start: 1 subset (the empty set [])
๐ Your turnโ
Loading editorโฆ
๐ง Challenge yourselfโ
- Generate all permutations instead of subsets.
- Subsets without duplicates when the input has repeats.
- Combination sum: pick numbers (reuse allowed) that hit a target.
Continue the path โ Dynamic Programming