Learnixo
Challenges

Group Anagrams

intermediate 150 XP

Problem

Given a list of strings, group the anagrams together. An anagram is a word formed by rearranging the letters of another word.

Test Cases

Standard groups
Input: ["eat","tea","tan","ate","nat","bat"]
Expected: [["bat"],["nat","tan"],["ate","eat","tea"]]
Empty string
Input: [""]
Expected: [[""]]
Single char
Input: ["a"]
Expected: [["a"]]

Hints

AI Assistance