Backspace String Compare
EasyTwo Pointers
Decode it first. Clues, constraints, pattern and plan before any code.Two strings s and t are typed into blank text editors. The character # means backspace: it deletes the character before it, if there is one (backspacing an empty editor does nothing). Return true if both editors end up showing the same text.
s = "ab#c", t = "ad#c" → true (both become "ac")
s = "ab##", t = "c#d#" → true (both become "")
s = "a#c", t = "b" → false ("c" vs "b")Can you do it in O(1) extra space, without building the final strings?
Constraints
1 <= s.length, t.length <= 200sandtcontain only lowercase letters and#.