Problem 1312 · Hard

Minimum Insertion Steps to Make a String Palindrome

Fill a table over substrings: matching ends cost nothing beyond the inside, and mismatched ends cost one insertion.

Open the interactive visualisation