Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution {
- public:
- vector<int> frequencySort(vector<int>& nums) {
- map<int,int> m;
- for(int i:nums){
- m[i]++:
- }
- vector<int> ans;
- for(auto iter:m){
- int maxi=0;
- int num=-101;
- for(auto i:m){
- if(maxi<i.second){
- maxi=m.second;
- num=i.first;
- }
- }
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement