strings = ['cat', 'act', 'rat', 'hut', 'tar', 'tact']
anagrams = defaultdict(list)
for s in strings:
    anagrams[frozenset(list(Counter(s).items()))].append(s)
print([v for v in list(anagrams.values())])
print([x for v in list(anagrams.values()) if len(v) > 1 for x in v])
Find group of strings that are anagrams