Dsa
Recursion
Hard
Distinct Palindrome Partitions
Given a string, write a program to find all distinct palindrome partitions of the string. A palindrome is a string that reads the same backward as forward. The input consists of a single line containing the string s (1 ≤ |s| ≤ 20). Print all distinct palindrome partitions, with each partition on a new line. Each partition should be printed as a space-separated list of palindromes.
Example:
Input:
aba
Output:
a b a
a a b
a a a
aba
Key concepts
recursionstring manipulationbacktracking
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