Fewest Palindrome Cuts — Solution & Editorial
Precompute palindrome[i][j] by interval DP, then dp[i] = min cuts for the prefix of length i, extending from any j where s[j..i−1] is a palindrome.
Complexity: O(|S|2)
Precompute palindrome[i][j] by interval DP, then dp[i] = min cuts for the prefix of length i, extending from any j where s[j..i−1] is a palindrome.
Complexity: O(|S|2)