Backtracking: common mistakes
Backtracking code is short, so one missing line breaks it quietly: it runs, returns, and gives the wrong answer. Here are three slips in the template, on Subsets and Permutations: adding the list instead of a copy, not undoing a choice, and not giving a value back to the box. Under the box, subsets or allPermutations shows the answers recorded so far.
Pick a mistake and press play: Wrong runs the code with the mistake until it breaks, and the code marks the wrong line in red. Fixed runs the corrected code on the same input, with the corrected line in green.