from collections import defaultdict


class Solution:

    def groupAnagrams(self, strs: List[str]) ->List[List[str]]:
        orDict = defaultdict(list)
        result = []
        for st in strs:
            sort_st = ''.join(sorted(st))
            orDict[sort_st].append(st)
        for key in orDict:
            result.append(orDict[key])
        return result

cb6ac6995cd143019e674ca28188c8c689c5cbe6
<mask token>

<mask token>


class Solution:
    <mask token>

<mask token>


class Solution:

    def groupAnagrams(self, strs: List[str]) ->List[List[str]]:
        orDict = defaultdict(list)
        result = []
        for st in strs:
            sort_st = ''.join(sorted(st))
            orDict[sort_st].append(st)
        for key in orDict:
            result.append(orDict[key])
        return result

from collections import defaultdict


class Solution:

    def groupAnagrams(self, strs: List[str]) ->List[List[str]]:
        orDict = defaultdict(list)
        result = []
        for st in strs:
            sort_st = ''.join(sorted(st))
            orDict[sort_st].append(st)
        for key in orDict:
            result.append(orDict[key])
        return result
