[c++] || Sort Array by Increasing Frequency
\nclass Solution {\npublic:\n    vector<int> frequencySort(vector<int>& nums) {\n        map<int,int> mp;\n        for(int i=0;i<nums.size();i++){\n            
```\nclass Solution {\npublic:\n    vector<int> frequencySort(vector<int>& nums) {\n        map<int,int> mp;\n        for(int i=0;i<nums.size();i++){\n            mp[nums[i]]++;\n        }\n        priority_queue<pair<int,int>> pq;\n        for(auto it : mp){\n            pq.push({-it.second,it.first});\n        }\n        vector<int> result;\n        while(!pq.empty()){\n            int x = pq.top().first;\n            for(int i=0;i<abs(x);i++){\n                result.push_back(pq.top().second);\n            }\n            pq.pop();\n        }\n        return result;\n    }\n};\n```
['C', 'Heap (Priority Queue)']