Back to DSA
Palindrome Partitioning
hardGiven a string, split it into segments where every segment reads the same forwards and backwards (i.e., each segment is a palindrome). Return all such ways to partition the string.
Examples
Example 1:
Input:
s = "abba"Output:
[["a","b","b","a"],["a","bb","a"],["abba"]] Example 2:
Input:
s = "x"Output:
[["x"]]Hints
1234567