Given a list of lowercase English strings, group the strings that are anagrams of each other. Return a list of lists, where each sublist contains strings that are anagrams. The order of groups and the order of strings within each group does not matter.
Example 1
Input: [abc, cab, bca, xyz, zyx, yxz, foo]
Output: [[abc, cab, bca], [xyz, zyx, yxz], [foo]]
Explanation: Three groups: anagrams of abc, anagrams of xyz, and foo alone.
Example 2
Input: [mno, onm, nom, pqr, rpq]
Output: [[mno, onm, nom], [pqr, rpq]]
Explanation: Two groups: anagrams of mno, anagrams of pqr.
Constraints
Case 1
Input: ['listen', 'silent', 'enlist', 'google', 'gogole', 'abc', 'bac']
Expected: [['listen', 'silent', 'enlist'], ['google', 'gogole'], ['abc', 'bac']]
Case 2
Input: ['a', 'b', 'c', 'a']
Expected: [['a', 'a'], ['b'], ['c']]
Case 3
Input: ['']
Expected: [['']]
Case 4
Input: ['abcd', 'dcba', 'bcda', 'dabc', 'efgh']
Expected: [['abcd', 'dcba', 'bcda', 'dabc'], ['efgh']]