Javascript O(N + M) Time O(1) Space Simple Easy To Understand Solution
\n// ! O(N + M) Time Complexity where N and M are the length of \'s\' and \'t\' and we\'ll visit all characters of each input string \'s\' and \'t\' once in the
```\n// ! O(N + M) Time Complexity where N and M are the length of \'s\' and \'t\' and we\'ll visit all characters of each input string \'s\' and \'t\' once in the worst case\n// ! O(1) Space Complexity because we\'re using 2 variables as pointers to keep track of characters\n\n var backspaceCompare = function(s, t) {\n  let si = s.length - 1, ti = t.length - 1;\n\n  while (si >= 0 || ti >= 0) {\n    si = clearBackSpace(s, si);\n    ti = clearBackSpace(t, ti);\n\n    let sChar = s[si], tChar = t[ti];\n    if (sChar !== tChar) { return false; }\n\n    si--; ti--;\n  }\n\n  return true;\n};\n\nvar clearBackSpace = function(string, index) {\n  let skip = 0;\n\n  while (index >= 0) {\n    if (string[index] === \'#\') { skip++; index--; }\n    else if (skip > 0) { skip--; index--; }\n    else { break; }\n  }\n\n  return index;\n}\n```
['Two Pointers', 'JavaScript']