C++/Python3 Sort by Count
C++\nSince the range of numbers is limited, and I am using array to collect count for the performance.\ncpp\nvector<int> frequencySort(vector<int>& nums) {\n   
**C++**\nSince the range of numbers is limited, and I am using array to collect count for the performance.\n```cpp\nvector<int> frequencySort(vector<int>& nums) {\n    int cnt[201] = {};\n    for (auto n : nums)\n        ++cnt[n + 100];\n    sort(begin(nums), end(nums), [&](int a, int b) {\n       return cnt[a + 100] == cnt[b + 100] ? a > b : cnt[a + 100] < cnt[b + 100];\n    });\n    return nums;\n}\n```\n\n**Python 3**\n```python\nclass Solution:\n    def frequencySort(self, nums: List[int]) -> List[int]:\n        cnt = collections.Counter(nums)\n        return sorted(nums, key = lambda n: (cnt[n], -n))\n```
[]