[C++] solution || O(n) time & O(1) space complexity 100% faster
T = O(n) & S = O(n)    \n \n\n\n  stack<char> st;\n\tfor(int i = 0; i < S.size(); i++) {\n\t\tif(st.empty() || S[i] != st.top()) {\n\t\t\tst.push(S[i]);\n\t\t}\
###   T = O(n) & S = O(n)    \n ```\n\n\n  stack<char> st;\n\tfor(int i = 0; i < S.size(); i++) {\n\t\tif(st.empty() || S[i] != st.top()) {\n\t\t\tst.push(S[i]);\n\t\t}\n\t\telse {\n\t\t\tst.pop();\n\t\t}\n\t}\n\tstring Ans = "";\n\twhile(!st.empty()) {\n\t\tAns.push_back(st.top());\n\t\tst.pop();\n\t}\n\n\treverse(Ans.begin(), Ans.end());\n\treturn Ans;\n```\n\n        \n        \n###  T = O(n) & S = O(1)\n\n\t\t\n```\nint stptr = -1;\n for(int i = 0; i < S.size(); i++) {\n\tif(stptr == -1 || S[i] != S[stptr]) {\n\t\tstptr++;\n\t\tS[stptr] = S[i];\n\t}\n\telse {\n\t\tstptr--;\n\t}\n}\nS.erase(stptr+1,S.size());\n        return S;\n```
['C']