|
|
just read some titles abot hanoi tower and learn some algorithm like floyd and u 100% will can solve this problem if you wanna get 20 lines solutions, write me on dalydudan@gmail.com 3 ABC => 5 13 CCCCCBBBBBAAABC => 992 9 ABCCBACAB => 466 9 CCABBACCB => 292 10 ACCABBACCB => 585 the 5th test is really big, you might want to check long longs where it is needed try this test 50 CCCCC...CCCC (50 times) answer is 1125899906842623 |
|
|