Medium

Quiz

#131 Palindrome Partitioning

APPROACH

Given a string s, split it into substrings so that every substring is a palindrome. Return all possible such partitionings.

Example 1:

Input: s = "aab"
Output: [["a","a","b"],["aa","b"]]

Example 2:

Input: s = "a"
Output: [["a"]]
1 of 4
1:00

What is the optimal approach for this problem?