Skip to content
Veltoryx Technologies
ProProblem 13● MediumLeetCode #49 ↗2 min readUpdated 30 October 2026

Group Anagrams

Group words made of the same letters by giving each word a key, its sorted letters, and collecting words by key in a map.

01The problem

Group the words in strs that are anagrams of each other (same letters, any order). Return the groups in any order.

InputOutput
["eat","tea","tan","ate","nat","bat"][["eat","tea","ate"],["tan","nat"],["bat"]]
[""][[""]]

Loading the rest of the lesson…