Example 1
Input
aab
Output
1
Partition as ["aa", "b"] which requires 1 cut.
Full lesson preview
Given a string, partition it into palindromic substrings and return the minimum number of cuts needed.
Problem statement
Task
Examples
Input
aab
Output
1
Partition as ["aa", "b"] which requires 1 cut.
Input format
Output format
Constraints
Samples
Input
aab
Output
1
Split into "aa" | "b".