✅ Best C++ Solution || Time -> O(N) || Space O(1)
\nbool backspaceCompare(string s, string t) \n    {\n        int i=0;    \n        int j=0;\n        \n        for(int k=0;k<s.size();k++)\n        {\n         
```\nbool backspaceCompare(string s, string t) \n    {\n        int i=0;    \n        int j=0;\n        \n        for(int k=0;k<s.size();k++)\n        {\n            if(s[k]!=\'#\')\n            {\n                s[i]=s[k];\n                i++;\n            }\n            else if(i>0) i--;     // if back space found remove a character    \n            \n        }\n         \n        for(int k=0;k<t.size();k++)\n        {\n            \n            if(t[k]!=\'#\')\n            {\n                t[j]=t[k];\n                j++;\n            }\n            else if(j>0) j--;            // if back space found remove a character  \n     \n        } \n              \n        if(i!=j) return false;\n        \n        for(int k=0;k<i;k++)  //compare each character\n        {\n            if(s[k]!=t[k]) return false;\n        }\n        return true;\n    }\n```
[]