- 1
Choose, Explore, Unchoose
Backtracking walks a decision tree: commit to a branch, explore it fully, then undo — the current path lives on a stack.
Code orderMultiple choice - 2
Letter Case Permutation
Two branches per letter, one per digit — walk the case tree over a shared char array and record a string at every leaf.
Complete codeDebugMultiple choiceTrace - 3
Sum of All Subset XOR Totals
Include or exclude each element — 2^n leaves, one subset per leaf, XOR along the path and sum across the leaves.
Complete codeMultiple choiceTrace - 4
Letter Combinations of a Phone Number
Multi-way branching: each digit opens one level of the tree, and each of its letters is one branch — depth equals the number of digits.
Complete codeMultiple choiceTrace - 5
Permutations
Order matters: every unused element branches at every level, tracked by used[] flags — and every mark must be undone on the way back.
Complete codeDebugMultiple choiceTrace - 6
Generate Parentheses
Constrained branching: add '(' while open < n and ')' while close < open — invalid prefixes are never built, so no filtering is needed at the leaves.
Complete codeDebugMultiple choiceTrace - 7
Backtracking CheckpointCheckpoint
No new concepts — transfer the island's branching moves to unseen problems: choose-k LED selections, adjacency-constrained strings, and digit chains where pruning collapses the whole tree.
Code orderMultiple choiceTrace - 8
Backtracking ReviewReview
Mixed recap of the island: the choose/explore/unchoose contract, include/exclude vs used[] branching, why pruning beats filtering, copy-on-record, stack depth vs tree size, and 2^n vs n!.
Complete codeMultiple choice - 9
Boss: SubsetsBoss
The island's final test: enumerate the power set. Every element is one independent in/out decision — 2^n subsets including [] — and the boss's trap is recording a reference to the mutable path instead of a copy.
Complete codeDebugCode orderMultiple choiceTrace
Backtracking & Greedy is part of AlgoFox Pro
You can read the whole course outline here. The exercises are in the app, along with your streak, your mistake review, and the progress that carries across your devices.
Pro starts with a 3 day free trial. The app store decides who is eligible for an introductory offer, and a lapsed subscription does not get another one.
Already subscribed in the app? Sign in with the same account and Pro works here too. Quick Play and Battle are free on the web, and so is the first course in every subject.
