100% faster C++ solution
\nclass Solution \n{\npublic:\n    string helper(string s)\n    {\n        stack<char>stk;\n        for(auto it:s)\n        {\n            if(it!=\'#\')\n      
```\nclass Solution \n{\npublic:\n    string helper(string s)\n    {\n        stack<char>stk;\n        for(auto it:s)\n        {\n            if(it!=\'#\')\n            {\n                stk.push(it);\n            }\n            else if(!stk.empty())\n            {\n                stk.pop();\n            }\n        }\n        string ans="";\n        while(!stk.empty())\n        {\n            ans.push_back(stk.top());\n            stk.pop();\n        }\n        return ans;\n    }\n    bool backspaceCompare(string S, string T) \n    {\n        return helper(S)==helper(T);\n    }\n};\n```\n***Please upvote if you have got any help from my code. Thank you.***
['Stack', 'C']