Write group_anagrams(words) returning a list of groups (each a list of words in original order). Groups are ordered by the first appearance of their first word.
group_anagrams(['eat', 'tea', 'tan', 'ate', 'nat', 'bat']) → [['eat', 'tea', 'ate'], ['tan', 'nat'], ['bat']]
group_anagrams([]) → []
Submit runs 4 tests, including hidden edge cases.
Run your code to see the output here.