✅ 🎯 📌 Simple Solution || Beats 97.82% in Time ✅ 🎯 📌
Code\n\nclass Solution:\n    def sortString(self, s: str) -> str:\n        c=Counter(s)\n        ks=sorted(c.keys())\n        ans=\'\'\n        while len(ans)<l
# Code\n```\nclass Solution:\n    def sortString(self, s: str) -> str:\n        c=Counter(s)\n        ks=sorted(c.keys())\n        ans=\'\'\n        while len(ans)<len(s):\n            for i in ks:\n                if c[i]>0: ans, c[i] = ans+i, c[i]-1\n            for i in ks[::-1]:\n                if c[i]>0: ans, c[i] = ans+i, c[i]-1\n        return ans\n```
['Hash Table', 'String', 'Counting', 'Python3']