Best C++ Solution(5Line Code) Faster than 99% users. Time->O(n)
Solution is very easy dont need and explanation. If still comment down below.\n\nHope you like my solution. If yes Upvote so that others can also get help.\n\nT
Solution is very easy dont need and explanation. If still comment down below.\n\nHope you like my solution. If yes Upvote so that others can also get help.\n\nThanks for your time.\n\n    string removeDuplicates(string s) {\n        vector<char> out;\n        int i;\n        for(i=0;i<s.length();i++)\n        {\n            if(!out.empty() && out.back()==s[i] )\n                out.pop_back();\n            else\n                out.push_back(s[i]);\n        }\n        string ans(out.begin(),out.end());\n        return ans;\n    }
[]