Data Structures19 sections · 729 units
Open in Course

Problem - Group Anagrams

Hash with custom keys

Given an array of strings, group the anagrams together. You can return the answer in any order. Example: ["eat","tea","tan","ate","nat","bat"] Output: [["bat"],["nat","tan"],["ate","eat","tea"]] The challenge: how do you create a hash map key that identifies all anagrams of a word?