𝗖++ | 𝗦𝘁𝗮𝗰𝗸 | 𝗖𝗹𝗲𝗮𝗻 𝗖𝗼𝗱𝗲 | 𝟭𝟬𝟬% 𝗳𝗮𝘀𝘁𝗲𝗿
```\nclass Solution {\npublic:\n    bool backspaceCompare(string s, string t) {\n        \n        stack st,sts;\n        for(int i=0;i<s.length();i++){\n      
```\nclass Solution {\npublic:\n    bool backspaceCompare(string s, string t) {\n        \n        stack<int> st,sts;\n        for(int i=0;i<s.length();i++){\n            if(!st.empty() && s[i]==\'#\'){\n                st.pop();   \n            }\n            else if(s[i]!=\'#\') st.push(s[i]);\n        }\n        \n        \n        for(int i=0;i<t.length();i++){\n            if(!sts.empty() && t[i]==\'#\' ){\n                sts.pop();\n            }\n            else if(t[i]!=\'#\') sts.push(t[i]);\n        }\n        \n        if(sts==st) return true;\n        return false;\n    }\n};
['Stack', 'C']