this post was submitted on 01 Jun 2026
520 points (98.9% liked)
Programmer Humor
31645 readers
465 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
This instructions seem incomplete.
Consider a tower of three, moving from the left to right:
321 / - / -
32 / - / 1
3 / 2 / 1
Next, 1 should be moved to the center position on top of two for the optimal solution, but your ruleset has no indicator of which choice should be made.
You're right, how can we simplify that into a usable insite?
For each tower of size N, move tower (N - 1) to the non-target position, then move the base to the target position, then move the previously moved tower of size (N - 1) to the target position.