Easy to understand || Sorting || Mapping
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: O(nlogn)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\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    bool mycompare(const pair<int,int> &lhs,const pair<int,int> &rhs){\n        if(lhs.first != rhs.first)\n            return lhs.first < rhs.first;\n        return lhs.second > rhs.second;\n    }\n    vector<int> frequencySort(vector<int>& nums) {\n        unordered_map<int,int> mp;\n        vector<pair<int,int>> v;\n\n        for(auto it:nums)\n            mp[it]++;\n\n        for(auto it:mp)\n            v.push_back({it.second,it.first});\n        \n        sort(v.begin(),v.end(),[](const pair<int,int> &lhs,const pair<int,int> &rhs){\n        if(lhs.first != rhs.first)\n            return lhs.first < rhs.first;\n        return lhs.second > rhs.second;\n        });\n        vector<int> ans;\n        for(auto it:v){\n            while(it.first){\n                ans.push_back(it.second);\n                it.first--;\n            }\n        }\n        return ans;\n    }\n};\n```
['C++']