One line Python


  • 0
    def frequencySort(self, s):
        return ''.join([kV[0] * kV[1] for kV in sorted([(value,key) for (key,value) in collections.Counter(s).items()])])[::-1]
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.