':type strs: List[str]
:rtype: List[List[str]]'

def groupAnagrams(self, strs):

    (anagrams_map, result) = (collections.defaultdict(list), [])
    for s in strs:
        sorted_str = ''.join(sorted(s))
        anagrams_map[sorted_str].append(s)
    for anagram in anagrams_map.values():
        anagram.sort()
        result.append(anagram)
    return result
