Medium data structure and algorithm practice puzzle.
Given n disks on peg A, return the moves, like "A->C", that move them all to peg C. You can only move one disk at a time and never put a bigger disk on a smaller one. Recursively: move the top n - 1 disks to the spare peg, move the biggest disk to C, then move the n - 1 disks onto it. It takes 2^n - 1 moves.
Solve it three ways: snap the jigsaw pieces together, fill in the blanks, or type it from scratch against the tests. This one is free.
Every line of the solution comes with a note explaining why it is there, and a step by step replay shows the code running. At level 3, where you type it yourself, you can ask for an AI mock interview on this problem that ends with a hiring manager's scorecard.
Then grow it into a real project with the Software Engineer button: this puzzle becomes the Trip Expression Evaluator, a pipeline you can run and download. See every Software Engineer project.
Browse all 576 puzzles