Given a string s, partition s such that every substring of the partition is a palindrome.
Return the minimum cuts needed for a palindrome partitioning of s.
For example, given s = "aab"
,
1
since the palindrome partitioning ["aa","b"]
could be produced using 1 cut. class Solution {public: int minCut(string s) { if(s.empty())return 0; int n=s.length(); bool **T=new bool*[n]; for(int i=0;i=0;i--) { cut[i]=n-i; for(int j=i;j =0&&right =0&&right =0;i--) { cut[i]=n-i; for(int j=i;j