3 ms·
Yeah it is a weird problem. I actually got asked a similar problem about seven or eight years ago (but was not presented as a tower of hanoi problem) - and the
by roflyear 4y ago
Yeah it is a weird problem. I actually got asked a similar problem about seven or eight years ago (but was not presented as a tower of hanoi problem) - and the interviewer asked if I could come up with a closed-form solution.
I think one does exist and is not too crazy to understand but that was a trip.
- sudosysgen 4y agoYou can use the the recursive solution to generate the closed form solution. The interviewer was asking you for the closed form solution to see if you could exactly compute the complexity of a recursion.