Dsa
Strings
Medium
Palindrome Grouping
You are given a list of strings. Write a program to group these strings such that each group contains strings that can be rearranged to form a palindrome. Print the grouped strings as lists within a list.
Example:
Input: ['civic', 'ivicc', 'hello', 'olleh', 'aabb', 'bbaa']
Output: [['civic', 'ivicc'], ['hello', 'olleh'], ['aabb', 'bbaa']] (Order of groups and strings within groups doesn't matter)
Key concepts
stringspalindromesgrouping
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