Find minimum cuts to partition into palindromes. First, precompute = true if is a palindrome. = min cuts for .
If is palindrome, . Else, try all cuts. ("a"). ("aa" is palindrome). ("aab" needs cut: "aa" + "b"). Pre-computing the palindrome table avoids redundant checks during the DP. This is a common preprocessing pattern.