Python using stack, easy to understand
\ndef removeDuplicates(self, s: str) -> str:\n\tstk = []\n\tfor i in s:\n\t\tif(len(stk) == 0):\n\t\t\tstk.append(i)\n\t\telif(stk[-1] == i):\n\t\t\tstk.pop()\n
```\ndef removeDuplicates(self, s: str) -> str:\n\tstk = []\n\tfor i in s:\n\t\tif(len(stk) == 0):\n\t\t\tstk.append(i)\n\t\telif(stk[-1] == i):\n\t\t\tstk.pop()\n\t\telse:\n\t\t\tstk.append(i)\n\n\treturn "".join(stk)\n```\n\nUpvote if liked
['Python']