Easy C++ solution Beat 90%✅✅
\n# Code\n\nclass Solution {\npublic:\n    string removeDuplicates(string s) {\n        string ans="";\n        int i=0;\n       while(i<s.length()){\n         
\n# Code\n```\nclass Solution {\npublic:\n    string removeDuplicates(string s) {\n        string ans="";\n        int i=0;\n       while(i<s.length()){\n           if(ans.length()>0){\n            if(ans[ans.length()-1]==s[i])\n            ans.pop_back();\n            else\n            ans.push_back(s[i]);\n            }\n             else\n            ans.push_back(s[i]);\n            i++;\n        }\n        return ans;\n    }\n};\n```
['C++']