Simple C++ Solution
\nclass Solution {\npublic:\n    vector<int> frequencySort(vector<int>& nums) {\n        unordered_map <int,int> mp;\n        priority_queue <pair <int,int>> q;
```\nclass Solution {\npublic:\n    vector<int> frequencySort(vector<int>& nums) {\n        unordered_map <int,int> mp;\n        priority_queue <pair <int,int>> q;\n        for(int i=0;i<nums.size();i++){\n            mp[nums[i]]++;\n        }\n        for(auto &i:mp){\n            q.push({-i.second,i.first});\n        }\n        nums.clear();\n        while(!q.empty()){\n            for(int i=0;i<-(q.top().first);i++){\n                nums.push_back(q.top().second);\n            }\n            q.pop();\n        }\n        return nums;\n    }\n};\n```
['Array', 'Hash Table', 'Sorting', 'Heap (Priority Queue)', 'C++']