Given 2 strings containing regular characters and backspace characters (represented by "<"), return true if both strings are the same after all backspaces are processed and false otherwise. ie) should return true for "abc<<de<f" and "adca<<f"
Anonymous
it could be solved by a diff ways. Like using 2 stacks - add characters on top and delete top once you faced with <. After that you can pop chars from each stack and compare. It requires O(n) memory.
Check out your Company Bowl for anonymous work chats.