CodeMentor.
Ask AIProblemsLearnC++TCSCore CSHRProgress
0Lv 1
ProblemsHashing

Group Anagrams

Medium
LeetCode
3/8
MediumHashingLeetCode #49

Group Anagrams

Key = sorted string (or 26-count signature). Map key → list of words.

Examples

Example 1

Input

6
eat tea tan ate nat bat

Output

ate eat tea | bat | nat tan

Stuck? Take a nudge

C++17Autosaves