Easy C++ Solution using unordered_map
\n# Code\n\nclass Solution {\npublic:\n    vector<int> frequencySort(vector<int>& nums) {\n        unordered_map<int,int> mp;\n        for(int i : nums){\n     
\n# Code\n```\nclass Solution {\npublic:\n    vector<int> frequencySort(vector<int>& nums) {\n        unordered_map<int,int> mp;\n        for(int i : nums){\n            mp[i]++;\n        }\n        sort(nums.begin(), nums.end(), [&](int n1, int n2){\n            if(mp[n1] == mp[n2]){\n                return n1 > n2;\n            }\n            return mp[n1] < mp[n2];\n        });\n        return nums;\n    }\n};\n```
['Hash Table', 'Sorting', 'C++']