5-line easy understand python solution

  • 0

    It's vey straight forward, but it's not the best solution.

    def groupAnagrams(self, strs):
            :type strs: List[str]
            :rtype: List[List[str]]
            for i in xrange(len(strs)):
                # sorted the key 
                # if the key is the same plus
            return [v for v in hashmap.values()]

Log in to reply

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