Print all Palindromic Partitions of a String

Difficulty Level Medium
Frequently asked in Amazon Facebook Google
Backtracking Depth First Search Dynamic Programming String

Problem Statement

In the “Print all Palindromic Partitions of a String” problem we have given a string “s”. Write a program to print all possible palindromic partitioning of s. A palindrome is a word, number, phrase, or another sequence of characters that reads the same backward as forward, such as madam or racecar.

Input Format

The first and only one line containing the given string “s”.

Output Format

Print N lines where every line containing the partition of the string “s”. Here N is the total number of different partitions possible of string “s”.


  • 1<=|s|<=16
  • s[i] must be a lower English letters



Array Interview Questions
Graph Interview Questions
LinkedList Interview Questions
String Interview Questions
Tree Interview Questions
Core Java Interview Questions