LC131 - Palindrome Partitioning
Problem
Given a string s
, partition s
such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s
.
Example
Input: s = "aab"
Output: [["a","a","b"],["aa","b"]]
Solution
Use an array to cache palindromity of substring. Time and space complexity is .
Last updated