:type s: str :rtype: str
(self, s)
| 51 | """ |
| 52 | class Solution(object): |
| 53 | def frequencySort(self, s): |
| 54 | """ |
| 55 | :type s: str |
| 56 | :rtype: str |
| 57 | """ |
| 58 | |
| 59 | x = {} |
| 60 | |
| 61 | for i in s: |
| 62 | try: |
| 63 | x[i] += 1 |
| 64 | except: |
| 65 | x[i] = 1 |
| 66 | |
| 67 | b = sorted(x, key=lambda t: x[t], reverse=True) |
| 68 | |
| 69 | return ''.join([i*x[i] for i in b]) |
| 70 |
nothing calls this directly
no outgoing calls
no test coverage detected