Anagram Group Finder

Medium
string hash-table sorting
Problem Description

Group words that are anagrams of each other. Words in same group should be together.

Input Format
First line contains n. Next n lines contain words.
Output Format
Groups of anagrams, each group on separate line with words space-separated
Constraints
1 ≤ n ≤ 100, word length ≤ 20
Sample Input/Output
Input:
6
eat
tea
tan
ate
nat
bat
Output:
eat tea ate
tan nat
bat
Explanation

Group words that are anagrams of each other

Solution Hints
  • Read carefully: Understand input/output format and constraints
  • Start simple: Think of brute force solution first, then optimize
  • Edge cases: Consider empty inputs, single elements, max constraints
  • Data structures: Choose arrays, hash maps, sets based on problem needs
  • Time complexity: Ensure your solution fits within time limits
  • Test examples: Verify logic with provided sample inputs
190
Points
2000ms
Time Limit
256MB
Memory Limit
Code Editor
Register to Submit
Register to Access Code Editor

Create a free account to solve coding problems and track your progress.

Register Now
Feedback