Increasing Decreasing String Solution in C++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n^2)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(n)\n# Code\n```\nclass Solution {\npublic:\n    string sortString(string s) {\n        int i, j;\n        map<char, int> mp;\n        string s1 = "";\n        string temp = "";\n        for(i=0 ; i<s.length() ; i++)\n        {\n            mp[s[i]]++;\n        }\n        while(s1.length()<s.length())\n        {\n            for(auto it:mp)\n            {\n                if(it.second>0)\n                {\n                    s1 += it.first;\n                    mp[it.first]--;\n                }\n            }\n            for(auto it:mp)\n            {\n                if(it.second>0)\n                {\n                    temp += it.first;\n                    mp[it.first]--;\n                }\n            }\n            reverse(temp.begin(), temp.end());\n            s1 += temp;\n            temp.clear();\n        }\n        return s1;\n    }\n};\n```\n![upvote new.jpg](https://assets.leetcode.com/users/images/2e9c2751-1d66-4083-b92e-5a6b1792cb52_1684994282.0868623.jpeg)\n
['C++']