simple and easy C++ solution 😍❤️‍🔥
\n# if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n\n###### Let\'s Connect on LinkedIn: www.linkedin.com/in/shishirrsiam\n###### Let\'s Connect on Facebook
\n# if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n\n###### Let\'s Connect on LinkedIn: www.linkedin.com/in/shishirrsiam\n###### Let\'s Connect on Facebook: www.fb.com/shishirrsiam\n\n# Complexity\n- Time complexity: O(nlogn)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    string ans;\n    void CharErase(map<char, int> &mp, char ch)\n    {\n        if(mp.find(ch) != mp.end())\n        {\n            ans += ch;\n            mp[ch]--;\n            if(not mp[ch]) mp.erase(ch);\n        }\n    }\n    string sortString(string s) \n    {\n        map<char, int> mp;\n        for(char ch:s) mp[ch]++;\n        \n        while(mp.size())\n        {\n            for(char ch=\'a\'; ch <= \'z\'; ch++)\n                CharErase(mp, ch);\n            for(char ch=\'z\'; ch >= \'a\'; ch--)\n                CharErase(mp, ch);\n        }\n        return ans;\n    }\n};\n```
['Hash Table', 'String', 'Counting', 'C++']