Recap: Check What You Undid and Copied

Every exercise in this section searched through choices one at a time. What separated a working search from a broken one was usually what got undone, what got copied, and which branches were never explored. Here’s the question that unlocked each one:

Exercise The question that unlocked it
Review an AI-Written Topping Combiner Which array does each saved combination point to once the search finishes?
Every Order of a Playlist Can this song go next, given the song I just placed?
Coupon Combinations for an Exact Total Which coupons may still come after the last one I picked, and do any of them fit what’s left?
Find a Word on a Game Board Is the next letter on a neighboring tile that this trace hasn’t used yet?

A quick self-check: think of the test that stayed red the longest for you. Which assumption in your code did it break? Interviewers often ask exactly that kind of question, and it’s a lot easier to answer once you’ve talked it through.

Want a second pair of eyes on your Backtracking work?

Backtracking builds every answer. The Dynamic Programming section asks questions where listing every answer would take forever, so you’ll count or optimize them instead.

Become a Member to join the conversation.