Python | O(n^2) passed
\n\n# Code\n\nclass Solution:\n    def clearStars(self, s: str) -> str:\n        stack = []\n\n        for char in s:\n            if char != "*":\n            
\n\n# Code\n```\nclass Solution:\n    def clearStars(self, s: str) -> str:\n        stack = []\n\n        for char in s:\n            if char != "*":\n                stack.append(ord(char))\n            else:\n                index = stack[::-1].index(min(stack))\n                stack.pop(len(stack) - 1 - index)\n        res = ""\n\n        for c in stack:\n            res += chr(c)\n        return res\n\n```
['Python3']