You are viewing a single comment's thread. Return to all comments →
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