Palindrome partition cuts

Write codeHard34 minGoogle style

Your task

Given a string s, partition it into contiguous substrings such that every part is a palindrome, and return the MINIMUM number of cuts needed. A single character is a palindrome; a string already palindromic needs 0 cuts. 1 <= len(s) <= 2000, lowercase letters. Example: 'aab' -> 1 (cut into 'aa' | 'b').

Examples

min_palindrome_cuts(s: str) -> int
Example 1
Inputmin_palindrome_cuts("aab")
Output1