C++ Easy using map
\nclass Solution {\npublic:\n    string sortString(string s) {\n        map<char, int>mpp;\n        string ans="";\n        for(int i=0; i<s.length(); i++){\n  
```\nclass Solution {\npublic:\n    string sortString(string s) {\n        map<char, int>mpp;\n        string ans="";\n        for(int i=0; i<s.length(); i++){\n            mpp[s[i]]++;\n        }\n        \n        map<char, int>::iterator itr;\n        map<char, int>::reverse_iterator it;\n        \n        while(s.size() != ans.size()){\n            for(itr = mpp.begin(); itr != mpp.end(); ++itr){\n                if(itr->second>0){\n                    ans+=itr->first;\n                }\n                itr->second--;\n            }\n            \n            for (it = mpp.rbegin(); it != mpp.rend(); it++){\n                if(it->second>0){\n                    ans+=it->first;\n                }\n                it->second--;\n            }\n        }\n        return ans;\n    }\n};\n```
['C']