✅✅Easy C++ Solution || Simple to Understand
\tclass Solution {\n\tpublic:\n\t\tstring removeDuplicates(string s) {\n\n\t\t\tstring ans;\n\t\t\tans.push_back(s[0]);\n\n\t\t\tfor(int i=1 ; i<s.length() ; i+
\tclass Solution {\n\tpublic:\n\t\tstring removeDuplicates(string s) {\n\n\t\t\tstring ans;\n\t\t\tans.push_back(s[0]);\n\n\t\t\tfor(int i=1 ; i<s.length() ; i++){\n\n\t\t\t\tif(!ans.empty() && s[i] == ans.back()){\n\t\t\t\t\tans.pop_back();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tans.push_back(s[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn ans;\n\t\t}\n\t};\nI hope that you\'ve found the solution useful.\nIn that case, please do upvote. Happy Coding :)
['String', 'C', 'C++']