EASY AND EFFICIENT SOLUTION C++
Intuition\n Describe your first thoughts on how to solve this problem. \nEasy C++ Solution Using Lambda Function and Hash Table.\n# Approach\n Describe your app
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nEasy C++ Solution Using Lambda Function and Hash Table.\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(nlogn)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n\n- Space complexity: O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n\n# Code\n```\nclass Solution {\npublic:\n    // USING LAMBDA FUNCTION\n    vector<int> frequencySort(vector<int>& nums) {\n        unordered_map<int,int> mp;\n\n        for(int i = 0 ; i < nums.size() ; i++)\n        mp[nums[i]]++;\n\n        sort(nums.begin(), nums.end(),\n        [&] (int a , int b){return mp[a]!=mp[b] ? mp[a] < mp[b] : a > b;});\n\n        return nums;\n    }\n};\n```
['Hash Table', 'Sorting', 'C++']