Skip to main content

๐ŸŽฎ 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
1
Start: 1 subset (the empty set [])

๐Ÿ Your turnโ€‹

Loading editorโ€ฆ

๐Ÿง  Challenge yourselfโ€‹

  1. Generate all permutations instead of subsets.
  2. Subsets without duplicates when the input has repeats.
  3. Combination sum: pick numbers (reuse allowed) that hit a target.

Continue the path โ†’ Dynamic Programming