Solve the Hanoi Towers problem to get the encoded solution