Courses

Backtracking & Greedy

Explore decision trees with undo, prune dead branches early, and learn when one locally best choice is provably enough.

Islands
4
Lessons
36
Exercises
229
Complete codeDebugCode orderFill blankMultiple choiceTrace
    1. Choose, Explore, Unchoose6 exercises, 5 min
    2. Letter Case Permutation6 exercises, 6 min
    3. Sum of All Subset XOR Totals7 exercises, 7 min
    4. Letter Combinations of a Phone Number6 exercises, 6 min
    5. Permutations6 exercises, 7 min
    6. Generate Parentheses6 exercises, 7 min
    7. Backtracking CheckpointCheckpoint6 exercises, 7 min
    8. Backtracking ReviewReview6 exercises, 6 min
    9. Boss: SubsetsBoss8 exercises, 10 min
  1. Island 2

    Combinations

    1. Order Doesn't Matter6 exercises, 5 min
    2. Choose k of n6 exercises, 6 min
    3. Combination Sum III6 exercises, 7 min
    4. Subsets With Duplicates6 exercises, 7 min
    5. Combination Sum II6 exercises, 7 min
    6. Palindrome Partitioning6 exercises, 7 min
    7. Combinations CheckpointCheckpoint6 exercises, 7 min
    8. Combinations ReviewReview6 exercises, 6 min
    9. Boss: Combination SumBoss8 exercises, 10 min
    1. Search Under Constraints6 exercises, 5 min
    2. Word Search6 exercises, 6 min
    3. Restore IP Addresses7 exercises, 7 min
    4. Path with Maximum Gold6 exercises, 7 min
    5. Matchsticks to Square7 exercises, 7 min
    6. Beautiful Arrangement6 exercises, 7 min
    7. Constraint Search CheckpointCheckpoint6 exercises, 7 min
    8. Constraint Search ReviewReview6 exercises, 6 min
    9. Boss: N-QueensBoss8 exercises, 10 min
    1. Commit and Never Look Back6 exercises, 5 min
    2. Assign Cookies6 exercises, 6 min
    3. Lemonade Change6 exercises, 6 min
    4. Stock Trading, Greedily6 exercises, 6 min
    5. Jump Game7 exercises, 7 min
    6. Partition Labels7 exercises, 7 min
    7. Greedy CheckpointCheckpoint6 exercises, 7 min
    8. Greedy ReviewReview6 exercises, 6 min
    9. Boss: Gas StationBoss8 exercises, 10 min
AlgoFox Pro

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.

Download AlgoFox on the App StoreGet AlgoFox on Google Play

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.