Find all possible palindromic partitions of a String
Hard Accuracy: 60.06% Submissions: 5319 Points: 8

Given a String S, Find all possible Palindromic partitions of the given String.

Example 1:

S = "geeks"
g e e k s
g ee k s
All possible palindromic partitions
are printed.

Example 2:

S = "madam"
m a d a m
m ada m

Your Task:
You don't need to read input or print anything. Your task is to complete the function allPalindromicPerms() which takes a String S as input parameter and returns a list of lists denoting all the possible palindromic partitions.


Expected Time Complexity: O(N*2N)
Expected Auxiliary Space: O(N2), where N is the length of the String


1 <= |S| <= 20

We are replacing the old Disqus forum with the new Discussions section given below.
Click here to view old Disqus comments.

to report an issue on this page.


We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?


All Submissions

My Submissions:

Login to access your submissions.

Find all possible palindromic partitions of a String

Output Window