Dsa
Backtracking
Hard
Diverse Palindromic Partitions
Given a string, find all possible unique palindromic partitions of the string. Each substring should be a palindrome. Print each partition as space-separated words.
Input Format:
A single line containing the string (length ≤ 20).
Output Format:
Print each palindromic partition on a new line.
Example:
Input:
racecar
Output:
racecar
r acecar
ra ce car
race car
r a c e c a r
Key concepts
backtrackingpalindromesstring manipulation
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