You are viewing a single comment's thread. Return to all comments →
This is Wonderful and Elegant!!!
I tried using hell a lot of stacks to make the 'Undo' operation work and made it very complex.
Thank you! :)
Not really. You can think that this is a simple brute-force solution, which will not win you the interviews.
Try to think of a efficient way storing things in the stack (i.e. store only the info needed foe undo). The code will be much linger