Dsa
Strings
Easy
Anagram Finder
Develop a function that takes a list of words and returns a list of groups of anagrams. An anagram is a word formed by rearranging the letters of another. The output should consist of lists of anagrams grouped together, with each group containing at least two words.
Input: First line N (1 ≤ N ≤ 100), followed by N words (1 ≤ |word| ≤ 100).
Output: A list of lists containing grouped anagrams.
Example:
Input:
5
listen
silent
enlist
hello
world
Output:
[['listen', 'silent', 'enlist']]
Key concepts
stringsanagramssorting
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