1636. Sort Array by Increasing Frequency Updated: 2024-03-12 1 min read Algorithms , LeetCode On This PageLeetCode problem 1636class Solution: def frequencySort(self, nums: List[int]) -> List[int]: cnt = Counter(nums) return sorted(nums, key=lambda x: (cnt[x], -x))