Return the fewest cuts needed to split s into pieces that are all palindromes. A string that is already a palindrome needs 0 cuts.
For "aab" the answer is 1 ("aa" | "b").
The starter code re-checks pieces and repeats work. It is correct but too slow for long strings.
Example 1
Input:
min_cut_palindromes('aab')
Output:
1
Example 2
Input:
min_cut_palindromes('ab')
Output:
1
0 <= len(s) <= 1000No results yet
Run your code to check it against the examples, or submit to run every test.