You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def groupAnagrams(strs): #Must return list of lists
res = defaultdict(list)
for s in strs:
sortedS = ''.join(sorted(s)) #Using a trick there to solve the problem, I sort every word in the strs argument, making an anagram effectively a copy of eachother