C++ Easy solution without stack
\nclass Solution {\npublic:\n    string removeDuplicates(string s) {\n        \n     for(int i=0;i<s.length();i++)\n     {\n         \n         if(s[i]==s[i+1])
```\nclass Solution {\npublic:\n    string removeDuplicates(string s) {\n        \n     for(int i=0;i<s.length();i++)\n     {\n         \n         if(s[i]==s[i+1])\n         {\n             s.erase(i,2);\n             if(i==0)\n             i=-1;\n             else\n             i=i-2;\n         }\n         \n     }\n        return s;\n        \n    }\n};\n\n```
[]