1636. Sort Array by Increasing Frequency
class Solution:
def frequencySort(self, nums: List[int]) -> List[int]:
c = Counter(nums)
v = [x[0] for x in sorted(c.items(), key=lambda x:(x[1], -1 * x[0]))]
ans = []
for num in v:
ans += [nu...
tapanrachchh.hashnode.dev1 min read