✅Accepted || ✅Short & Simple || ✅Best Method || ✅Easy-To-Understand
\n# Code\n\nclass Solution {\npublic:\n    bool backspaceCompare(string s, string t) {\n        string a,b;\n        for(char c:s)\n        {\n            if(c!
\n# Code\n```\nclass Solution {\npublic:\n    bool backspaceCompare(string s, string t) {\n        string a,b;\n        for(char c:s)\n        {\n            if(c!=\'#\')\n                a.push_back(c);\n            else if(a.size() && c==\'#\')\n                a.pop_back();\n        }\n        for(char c:t)\n        {\n            if(c!=\'#\')\n                b.push_back(c);\n            else if(b.size() && c==\'#\')\n                b.pop_back();\n        }\n        return a==b;\n    }\n};\n```\nPlease **UPVOTE** if it helps \u2764\uFE0F\uD83D\uDE0A\nThank You and Happy To Help You!!
['C++']