Write a function to group anagrams from a list of strings.
HardProblem Statement
Write a function to group anagrams from a list of strings.
Sample Input
['eat', 'tea', 'tan', 'ate', 'nat', 'bat']
Sample Output
[['eat', 'tea', 'ate'], ['tan', 'nat'], ['bat']]
Limits
Time: 2s · Memory: 256 MB