favoredponcho@lemmy.zip to Programmer Humor@programming.dev · 16 hours agoAlgorithms course PTSDlemmy.zipexternal-linkmessage-square23linkfedilinkarrow-up1471arrow-down14
arrow-up1467arrow-down1external-linkAlgorithms course PTSDlemmy.zipfavoredponcho@lemmy.zip to Programmer Humor@programming.dev · 16 hours agomessage-square23linkfedilink
minus-squareSpaceNoodle@lemmy.worldlinkfedilinkarrow-up3·13 hours 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.