Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Group Anagrams

Medium Hashing

Given n words, group the words that are anagrams of each other. Print each group on its own line. Groups appear in order of the first word of the group in the input, and words keep their input order inside the group.

Constraints

1 <= n <= 10^4 Lowercase English letters, length <= 100

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.