4 lines phython solution


  • 0
    G

    '''

    class Solution(object):
        def groupAnagrams(self, strs):
            dic=collections.defaultdict(list)
            for word in strs:
                dic[''.join(sorted(word))].append(word)
            return dic.values()
    

    '''


Log in to reply
 

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