Skip to content

Commit

Permalink
Solution to #22
Browse files Browse the repository at this point in the history
  • Loading branch information
bharatr21 committed May 22, 2020
1 parent 8d67c46 commit 37ec8c6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Solutions/S22.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Solution:
def frequencySort(self, s: str) -> str:
return "".join([k * v for k, v in sorted(Counter(s).items(), key=lambda x: x[1], reverse=True)])

0 comments on commit 37ec8c6

Please sign in to comment.