Python 3   ||   5 lines, stack, w/ example   ||   T/S: 88% / 95%
\nclass Solution:\n    def removeDuplicates(self, s: str) -> str:\n                                                        #   Ex: azxxzy\n        stack = []\n 
```\nclass Solution:\n    def removeDuplicates(self, s: str) -> str:\n                                                        #   Ex: azxxzy\n        stack = []\n                                                        #   ch    stack      stack.pop()\n        for ch in s:                                    #  \u2013\u2013\u2013\u2013   \u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013  \u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\n            if stack and stack[-1]==ch: stack.pop()     #    a     [a]          \n            else: stack.append(ch)                      #    z     [a,z]\n                                                        #    x     [a,z,x]\n        return \'\'.join(stack)                           #    x     [a,z]          x\n                                                        #    z     [a]            z\n                                                        #    y     [a,z]         --> \'\'.join([a,z]) = az\n```\n[https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string/submissions/1273666103/](https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string/submissions/1273666103/)\n\nI could be wrong, but I think that time complexity is *O*(*N*) and space complexity is *O*(*N*), in which *N* ~ `len(s)`.
['Stack', 'Python']