C++ simple and short with custom comparator lambda function
\nvector<int> frequencySort(vector<int>& nums) {\n\tmap<int, int> freq;\n\tfor (int n : nums)\n\t\tfreq[n]++;\n\tsort(nums.begin(), nums.end(),\n\t\t\t[&freq](c
```\nvector<int> frequencySort(vector<int>& nums) {\n\tmap<int, int> freq;\n\tfor (int n : nums)\n\t\tfreq[n]++;\n\tsort(nums.begin(), nums.end(),\n\t\t\t[&freq](const int& a, const int& b) {\n\t\t\t\treturn (freq[a] == freq[b]) ? a > b : freq[a] < freq[b];\n\t});\n\treturn nums;\n}\n```\n
['C', 'C++']