Python 3 using regex
It\'s not the most efficient, but it\'s pretty simple.\n\n\nimport re\n\nclass Solution:\n  def removeDuplicates(self, S: str) -> str:\n    last = None\n    whi
It\'s not the most efficient, but it\'s pretty simple.\n\n```\nimport re\n\nclass Solution:\n  def removeDuplicates(self, S: str) -> str:\n    last = None\n    while last != S:\n      last, S = S, re.sub(r\'(.)\\1\', \'\', S)\n    return S\n```
[]