All Palindromic Partitions

medium
1. You are given a string of length n.
2. You have to partition the given string in such a way that every partition is a palindrome.

Note -> Check out the question video and write the recursive code as it is intended without 
               changing signature. The judge can't force you but intends you to teach a concept.

Input Format

A String of length n

Output Format

Check the sample ouput and question video.

Constraints

1 <= length of string <= 15

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
pep
Output
(p) (e) (p) 
(pep) 
Previous
All Palindromic Permutations
Next
K Subsets With Equal Sum

Related Questions