Minimum Insertions to Palindrome — Solution & Editorial
The answer is |S| minus the longest palindromic subsequence, computed by interval DP.
Complexity: O(|S|²)
The answer is |S| minus the longest palindromic subsequence, computed by interval DP.
Complexity: O(|S|²)