LeetCode 1636 Sort Array by Increasing Frequency.
Asked in the OA stage. Given an integer array nums, return a new array sorted by increasing frequency. If two values have the same frequency, place the larger value first.
Implement def frequency_sort(nums):. Return all elements with the same multiplicities as the input.
def frequency_sort(nums):