[Python] Sort on (count,-value), 3 Lines
Have the sort key be the count of occurrences, and the negative of the value. O(nlogn),O(n) time and space.\n\n\nclass Solution:\n    def frequencySort(self, nu
Have the sort key be the count of occurrences, and the negative of the value. O(nlogn),O(n) time and space.\n\n```\nclass Solution:\n    def frequencySort(self, nums: List[int]) -> List[int]:\n        counter = collections.Counter(nums)\n        nums.sort(key=lambda x: (counter[x],-x))\n        return nums\n```
[]