Generate Tower of Hanoi moves | Apple Coding Question