C++ Simplest Solution || Beats 100 % || Easy to Understand
Intuition\nUsing two stacks\n\n# Approach\n1. Create two stacks, each for the strings.\n2. (Do this for the whole string) Push if the character is not equal to 
# Intuition\nUsing two stacks\n\n# Approach\n1. Create two stacks, each for the strings.\n2. (Do this for the whole string) Push if the character is not equal to #. If it is a #, then pop.\n3. Now after the second step, Keep popping and if any character(top) is not equal to the other one(other stack\'s top), return false, else true.\n\n# Code\n```\nclass Solution {\npublic:\n    bool backspaceCompare(string s, string t) {\n        stack<char> s1;\n        stack<char> s2;\n\n        for(char ch : s){\n\n            if(ch == \'#\'){\n                if(s1.empty())\n                    continue;\n                s1.pop();\n            }else{\n                s1.push(ch);\n            }\n        }\n\n        for(char ch : t){\n\n            if(ch == \'#\'){\n                if(s2.empty())\n                    continue;\n                s2.pop();\n            }else{\n                s2.push(ch);\n            }\n        }\n\n        while(!s1.empty() && !s2.empty()){\n            if(s1.top() != s2.top())\n                return false;\n\n            s1.pop();\n            s2.pop();\n        }\n\n        if(!s1.empty() || !s2.empty())\n            return false;\n\n        return true;\n    }\n};\n```
['String', 'Stack', 'C++']