Python3 Solution-Runtime 95.33% 52ms/ Memory 100% 14MB
Python\nclass Solution:\n    def sortString(self, s: str) -> str:\n        raw = {i:s.count(i) for i in set(s)}\n        seq = sorted(raw.keys())\n        out =
```Python\nclass Solution:\n    def sortString(self, s: str) -> str:\n        raw = {i:s.count(i) for i in set(s)}\n        seq = sorted(raw.keys())\n        out = ""\n        while sum(raw.values())>0:\n            for i in seq:\n                if raw[i]>0:\n                    out+=i\n                    raw[i]-=1\n            for i in seq[::-1]:\n                if raw[i]>0:\n                    out+=i\n                    raw[i]-=1\n        return out      \n                    \n```\n\n            \n
['Python3']