Easy and Explained C++ code | lambda expression
\nclass Solution {\npublic:\n    vector<int> frequencySort(vector<int>& nums) {\n        unordered_map <int,int> mp;\n        // we need to modify our sort func
```\nclass Solution {\npublic:\n    vector<int> frequencySort(vector<int>& nums) {\n        unordered_map <int,int> mp;\n        // we need to modify our sort function to do that we\'ll use \n        // lambda fnction\n        for(auto x: nums) mp[x]++;\n\t\t// [&](int a , int b) -> syntax of lambda exp. takes two input as we compare two values AND also use refrence as in our case ,need to acces mp (hashmap).\n        sort(nums.begin(),nums.end(),[&](int a , int b){\n            return mp[a]!=mp[b]?mp[a]<mp[b] : a>b;\n            // mp[a]<mp[b] --> it. corresponds to lesser frequncy \n            // a>b --> this to whose value is greater as said in que. store in dec.\n        });\n            return nums;\n    }\n    \n};\n```
['Array', 'C']