Given a string s, return the minimum number of cuts needed to partition s such that every substring in the partition is a palindrome. Pattern focus: Palindrome partitioning. This is the classic minimum-cut dynamic programming problem on palindromic substrings.
s = input string
minimum number of cuts
Example 1:
Input:
s = "aab"
Output:
1
Explanation:
Partition as aa | b.
Example 2:
Input:
s = "a"
Output:
0
Explanation:
A single character is already a palindrome.