C++ EASY SOLUTION
```\nclass Solution {\npublic:\n    string sortString(string s) {\n        map m;\n        for(char x: s) m[x]++;                               //map initilatio
```\nclass Solution {\npublic:\n    string sortString(string s) {\n        map<char,int> m;\n        for(char x: s) m[x]++;                               //map initilation map[ character, number of occurance ]\n        string v;\n        while(v.size()!=s.size()){                           \n            for(auto i= m.begin(); i!= m.end(); i++){        //iterating map form begining to end\n                if(i->second != 0){\n                    v+=i->first;\n                    m[i->first]--;\n                }\n            }\n            for(auto i= m.rbegin(); i!= m.rend(); i++){      //iterating map form end to begining\n                if(i->second != 0){\n                    v+=i->first;\n                    m[i->first]--;\n                }\n            }\n        }\n        return v;\n    }\n};
['C']