Dsa
Hashing
Easy
Find Anagrams
Given a list of words, group the anagrams together. An anagram is a word formed by rearranging the letters of another word. Write a program that outputs lists of grouped anagrams, where each group should be sorted alphabetically.
Input format:
A single line containing space-separated words.
Output format:
The output should be lists of grouped anagrams printed one per line.
Example:
Input:
bat tab eat tea tan ate
Output:
['bat', 'tab']
['ate', 'eat', 'tea']
['tan']
Key concepts
hashingstringsanagrams
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now