Simple C++ Approach using basic strings||No stack|| with detailed explanation
\n# Approach\n- Create a empty string temp\n- make a pointer i=0\n- iterate till (i<length of string )\n- if either the string is empty or the char is not equal
\n# Approach\n- Create a empty string temp\n- make a pointer i=0\n- iterate till (i<length of string )\n- if either the string is empty or the char is not equal to the last char at temp\npush the current character.\n- else\n    pop the last character of the temp string.\n    i++\nreturn temp.\n\n\n\n# Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(n)\n\n# Code\n```\nclass Solution {\npublic:\n    string removeDuplicates(string s) {\n        string temp = "";\n        int i = 0;\n        \n        while (i < s.length()) {\n            if (temp.empty() || s[i] != temp.back()) {\n                temp.push_back(s[i]);\n            } else {\n                temp.pop_back();\n            }\n            i++;\n        }\n        \n        return temp;\n    }\n};\n\n```\n# Please upvote if you liked my approach
['C++']