Coding Challenge

Group Anagrams

Medium
stringhashmap

Group words that are anagrams of each other.

Given an array of strings, group the anagrams together. The order of groups does not matter.

Examples

Input: strs = ["eat","tea","tan","ate","nat","bat"]

Output: groups like [["eat","tea","ate"],["tan","nat"],["bat"]]

Constraints

  • 0 <= strs.length

Preparing your coding workspace...