group_anagrams(words) that groups words that are anagrams of each other into lists, using a dict keyed by each word's sorted-letters signature. Return the groups as a list of lists; each group is in first-seen order, and groups appear in the order their signature was first encountered.group_anagrams(['eat', 'tea', 'tan', 'ate', 'nat', 'bat'])
[['eat', 'tea', 'ate'], ['tan', 'nat'], ['bat']]
'eat','tea','ate' share sorted signature 'aet'; 'tan','nat' share 'ant'; 'bat' is alone.
Key each word by `''.join(sorted(word))`.
Use `groups.setdefault(signature, []).append(word)`, then return `list(groups.values())`.