EASY C++ SOLUTION | HEAPS | MAPS
\nvector<int> frequencySort(vector<int>& nums) {\n        unordered_map<int, int> m;\n        unordered_map<int, int>::iterator it;\n        priority_queue<pair
```\nvector<int> frequencySort(vector<int>& nums) {\n        unordered_map<int, int> m;\n        unordered_map<int, int>::iterator it;\n        priority_queue<pair<int, int>> pq;\n        \n        vector<int> v;\n        int n = nums.size();\n        \n        for (int i = 0; i < n; i++) {\n            m[nums[i]]++;\n        }\n        \n        for (it = m.begin(); it != m.end(); it++) {\n            pq.push({-1 * it->second, it->first});\n        }\n        \n        while(pq.size() > 0) {\n            int freq = -1 * pq.top().first;\n            int elem = pq.top().second;\n            \n            for (int i = 0; i < freq; i++) v.push_back(elem);\n            pq.pop();\n        }\n        \n        return v;\n    }\n```
['C', 'Heap (Priority Queue)', 'C++']