Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def frequencySort(self, s: str) -> str:
- count = Counter(s)
- sort = sorted(count, key=count.get, reverse=True)
- a = ''
- for i in sort:
- a += i * count[i]
- return a
Advertisement
Add Comment
Please, Sign In to add comment