Palindrome Partitioning
Advanced Backtracking DSA practice problem on Onlearn.
Difficulty: medium.
Topics: Palindromic Partitioning of a String, Recursion, Backtracking, Strings, Palindromes, Time Complexity, Space Complexity, Functions, Arrays, Substrings, string processing, string operations, backtracking, recursion, time complexity analysis, Palindrome Partitioning.
You are given a string s, partition it in such a way that every substring is a palindrome. Return all such palindromic partitions of s. Note: A palindrome string is a string that reads the same backward as forward. Examples: Example 1: Input: s = "aab" Output: [ ["a","a","b"], ["aa","b"] ] Explanation: The first answer is generated by making three partitions. The second answer is generated by making two partitions. Example 2: Input: s = "aabb" Output: [ ["a","a","b","b"], ["aa","bb"], ["a","a","bb"], ["aa","b","b"] ]