C++ | Faster than 100% | Easy to Understand
\nclass Solution {\npublic:\n    string removeDuplicates(string s) {\n        string ans = "";\n        ans = ans + s[0];\n        for (int i=1; i<s.length(); i
```\nclass Solution {\npublic:\n    string removeDuplicates(string s) {\n        string ans = "";\n        ans = ans + s[0];\n        for (int i=1; i<s.length(); i++) {\n            if (s[i]==ans.back()) {\n                ans.pop_back();\n            }\n            else {\n                ans += s[i];\n            }\n        }\n        return ans;\n        \n    }\n};\n```
['C']