In Meta Messenger search tooling, you are given a list of lowercase strings and need to group together strings that are anagrams of each other. Return the grouped strings in any order.
Two strings are anagrams if they contain the same characters with the same frequencies, but possibly in a different order.
Implement a function that takes strs, a list of strings, and returns a list of groups, where each group is a list of strings that are anagrams of one another.
strs: List[str]List[List[str]]Example 1
strs = ["eat", "tea", "tan", "ate", "nat", "bat"][["eat", "tea", "ate"], ["tan", "nat"], ["bat"]]"eat", "tea", and "ate" share the same letters; "tan" and "nat" do as well.Example 2
strs = [""][[""]]Example 3
strs = ["a"][["a"]]1 <= len(strs) <= 10^40 <= len(strs[i]) <= 100strs[i] consists of lowercase English letters only