C++ || Single Pass Solution || 7 Lines Code || Easy && Explained
\nstring removeDuplicates(string s) {\n    string ans = "";\n    for (auto &i: s) {\n        //if current element of original string matches to last appended el
```\nstring removeDuplicates(string s) {\n    string ans = "";\n    for (auto &i: s) {\n        //if current element of original string matches to last appended element of ans\n        if (i == ans.back()){\n            //remove that element from ans\n            ans.pop_back();\n        }\n        else{\n            //append that element to ans\n            ans += i;\n        }\n    }\n    return ans;\n}\n```
['String', 'C']