<reponame>soamsy/leetcode<filename>src/0451_sort_characters_frequency.py
import collections
def frequencySort(s: str) -> str:
    count = collections.Counter(s)
    return ''.join(list(sorted(s, key=lambda c: (-count[c], c))))