Problem Description
Given a string A, partition A such that every substring of the partition is a palindrome.
Return the minimum cuts needed for a palindrome partitioning of A.
1 <= length(A) <= 501
The first and the only argument contains the string A.
Return an integer, representing the minimum cuts needed.
Input 1:
A = "aba"
Input 2:
A = "aab"
Output 1:
0
Output 2:
1
Explanation 1:
"aba" is already a palindrome, so no cuts are needed.
Explanation 2:
Return 1 since the palindrome partitioning ["aa","b"] could be produced using 1 cut.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.