1312. Minimum Insertion Steps to Make a String Palindrome
1312. Minimum Insertion Steps to Make a String Palindrome
Description
Given a string s
. In one step you can insert any character at any index of the string.
Return the minimum number of steps to make s
palindrome.
A Palindrome String is one that reads the same backward as well as forward.
Example 1:
1 | Input: s = "zzazz" |
Example 2:
1 | Input: s = "mbadm" |
Example 3:
1 | Input: s = "leetcode" |
Constraints:
1 <= s.length <= 500
s
consists of lowercase English letters.
Hints/Notes
- 2024/07/27
- range dp
- No solution from 0x3F
Solution
Language: C++
1 | class Solution { |