favoredponcho@lemmy.zip to Programmer Humor@programming.dev · 27 days agoAlgorithms course PTSDmessage-squaremessage-square25fedilinkarrow-up1581
arrow-up1581message-squareAlgorithms course PTSDfavoredponcho@lemmy.zip to Programmer Humor@programming.dev · 27 days agomessage-square25fedilink
minus-squareSpaceNoodle@lemmy.worldlinkfedilinkarrow-up3·26 days agoFor 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.
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.