Given an array of strings strs, group the anagrams together. You can return the answer in any order.
Example 1:
- Input: strs = [โeatโ,โteaโ,โtanโ,โateโ,โnatโ,โbatโ]
- Output: [[โbatโ],[โnatโ,โtanโ],[โateโ,โeatโ,โteaโ]]
- Explanation:
- There is no string in strs that can be rearranged to form โbatโ.
- The strings โnatโ and โtanโ are anagrams as they can be rearranged to form each other.
- The strings โateโ, โeatโ, and โteaโ are anagrams as they can be rearranged to form each other.
Example 2:
- Input: strs = [โโ]
- Output: [[โโ]]
Example 3:
- Input: strs = [โaโ]
- Output: [[โaโ]]
Constraints:
- 1 <= strs.length <= 104
- 0 <= strs[i].length <= 100
- strs[i] consists of lowercase English letters.