Use DP to solve the 'palindrome partition ii' to calculate the min cut for partition. O(n^2) to get all palindromes and O(n) DP to get the min cut.