JavaScript, easy to understand O(n) solution
\n- Time Complexity: O(n)\n- Space Comlexity: O(n)\n- n = Math.max(s.length, t.length)\nJavaScript\n/**\n * @param {string} s\n * @return {string}\n */\nconst p
\n- Time Complexity: O(n)\n- Space Comlexity: O(n)\n- `n = Math.max(s.length, t.length)`\n```JavaScript\n/**\n * @param {string} s\n * @return {string}\n */\nconst process = s => {\n    const res = [];\n    for (x of s.split(\'\')) {\n        x === \'#\' ? res.pop() : res.push(x);\n    }\n    return res.join(\'\')\n}\n/**\n * @param {string} S\n * @param {string} T\n * @return {boolean}\n */\nvar backspaceCompare = (S, T) => process(S) == process(T);\n```
['JavaScript']