Using string only '0ms' code c++ ! ! !
\n# Code\n\nclass Solution {\npublic:\n    string removeDuplicates(string s) {\n        string ans = "";\n        for(int i = 0; i < s.length(); i++){\n        
\n# Code\n```\nclass Solution {\npublic:\n    string removeDuplicates(string s) {\n        string ans = "";\n        for(int i = 0; i < s.length(); i++){\n            if(ans == ""){\n                ans.push_back(s[i]);\n            }\n            else if(ans.back()==s[i]){\n                ans.pop_back();\n            }\n            else{\n                ans.push_back(s[i]);\n            }\n        }\n        return ans;\n    }\n};\n```
['String', 'C++']