Assort Health wants to deduplicate short call transcript snippets before downstream review. Given a list of lowercase strings, group together all strings that are anagrams of each other and return the groups.
Two strings belong in the same group if they contain exactly the same characters with the same frequencies, regardless of order. Implement an algorithm that efficiently groups all such strings.
transcripts, a list of lowercase stringsExample 1
transcripts = ["listen", "silent", "enlist", "rat", "tar", "art"][["listen", "silent", "enlist"], ["rat", "tar", "art"]]Example 2
transcripts = ["", "", "abc", "bca", "xyz"][["", ""], ["abc", "bca"], ["xyz"]]"abc" and "bca" share the same letters.1 <= len(transcripts) <= 10^40 <= len(transcripts[i]) <= 100transcripts[i] contains only lowercase English letters