class Solution(object):
def groupAnagrams(self, strs):
"""
:type strs: List[str]
:rtype: List[List[str]]
"""
Len=len(strs)
Map={}
count=0
ans=[]
for i in range(Len):
curS=strs[i]
l=list(curS)
l.sort()
curSort="".join(l)
if curSort not in Map:
Map[curSort]=count
ans.append([curS])
count+=1
else:
index=Map[curSort]
ans[index].append(curS)
return ans