Code RoomLargest anagram group
MediumPrep Room Coding #434

Largest anagram group

CodingAlgorithms & data structuresEntry–Mid~15 min

Given a list of lowercase words, find the size of the largest group of words that are all anagrams of one another — that is, they use exactly the same letters with the same multiplicities. Duplicate words count as separate members of their group. Return 0 for an empty list. For example, in ["listen", "silent", "enlist", "hello"] the first three words form one anagram group of size 3, so the answer is 3. You should not compare every word against every other word.

Implement
largest_anagram_group(words: list[str]) → int
Examples
in[["listen","silent","enlist","hello"]]out3
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

0:00 of about 15 min
InputExpectedGot
[["listen","silent","enlist","hello"]]3not run yetsample