Accepted || Detail Explained || Stack Approach || ~TC:O(N)
Approach\n1. Take a stack \n2. Take a loop iterate from first to last char from given string\n    * Check if stack is empty then push current char into stack\n 
# Approach\n1. Take a stack \n2. Take a loop iterate from first to last char from given string\n    * Check if stack is empty then push current char into stack\n    * else check if stack top char is equal to current char then pop that form stack else push current char into stack\n3. At the end return the reverse order of the remaining characters inside the stack.\n\n# Complexity\n- Time complexity: o(N) **Reason:** We are iterating each char from string\n\n- Space complexity: o(N) **Reason:** Using stack\n\n# Code\n```\nclass Solution {\npublic:\n    string removeDuplicates(string s) {\n        string ans="";\n        stack<char> st;\n        for(int i=0;i<s.size();i++){\n            if(st.empty()){\n                st.push(s[i]);\n            }else{\n                if(st.top()==s[i]){\n                    st.pop();\n                }else{\n                    st.push(s[i]);\n                }\n            }\n        }\n        while(!st.empty()){\n            ans+=st.top();\n            st.pop();\n        }\n        reverse(ans.begin(),ans.end());\n        return ans;\n    }\n};\n```
['Stack', 'C++']