Clean Python Code
\nfrom collections import Counter\n\nclass Solution:\n    def sortString(self, s: str) -> str:\n        answer, ct, increase = [], Counter(s), True\n        ord
```\nfrom collections import Counter\n\nclass Solution:\n    def sortString(self, s: str) -> str:\n        answer, ct, increase = [], Counter(s), True\n        ordered_chars = sorted(set(s))\n        while ct:\n            tmp = []\n            for char in ordered_chars:\n                if ct[char] > 0:\n                    tmp.append(char)\n                    ct[char] -= 1\n                else:\n                    del ct[char]\n            if not increase:\n                tmp.reverse()\n            answer.extend(tmp)\n            increase = not increase\n        return \'\'.join(answer)\n```
[]