Search
⌘K

Leetcode 1312. Minimum Insertion Steps to Make a String Palindrome

Given a string s, compute the minimum number of character insertions anywhere to make it a palindrome. Key insight: this equals |s| minus the length of the longest palindromic subsequence (or LCS of s and reverse(s)), solvable with O(n^2) dynamic programming.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.