C++ solution using maps
This is question is a very slight modifictaion of https://leetcode.com/problems/sort-characters-by-frequency/\nThis is just a basic implementation :-)\n\nclass 
This is question is a very slight modifictaion of https://leetcode.com/problems/sort-characters-by-frequency/\nThis is just a basic implementation :-)\n```\nclass Solution {\npublic:\n    \n    static bool cmp(pair<int,int>&a, pair<int,int>&b) {\n        return  (a.second==b.second) ? a.first>b.first : a.second<b.second;\n    }\n    \n    \n    vector<int> frequencySort(vector<int>& nums) {\n        if(nums.size()==1) \n            return nums;\n        map<int,int> mp;\n        for(int i=0;i<nums.size();i++) \n        {\n            mp[nums[i]]++;\n        }\n        vector<pair<int,int>> val_freq;\n        for(auto m : mp) \n        {\n            val_freq.push_back(m);\n        }\n        sort(val_freq.begin(),val_freq.end(),cmp);\n        vector<int> result;\n        for(auto v : val_freq) {\n            for(int i=0;i<v.second;i++) {\n                result.push_back(v.first);\n            }\n        }\n        return result;\n    }\n};\n```\nTry this too: https://leetcode.com/problems/sort-characters-by-frequency/\nSolution: https://leetcode.com/problems/sort-characters-by-frequency/discuss/1146549/C%2B%2B-map-solution
['C', 'Sorting', 'C++']