Class Solution
java.lang.Object
g1301_1400.s1312_minimum_insertion_steps_to_make_a_string_palindrome.Solution
1312 - Minimum Insertion Steps to Make a String Palindrome.<p>Hard</p>
<p>Given a string <code>s</code>. In one step you can insert any character at any index of the string.</p>
<p>Return <em>the minimum number of steps</em> to make <code>s</code> palindrome.</p>
<p>A <strong>Palindrome String</strong> is one that reads the same backward as well as forward.</p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> s = “zzazz”</p>
<p><strong>Output:</strong> 0</p>
<p><strong>Explanation:</strong> The string “zzazz” is already palindrome we don’t need any insertions.</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> s = “mbadm”</p>
<p><strong>Output:</strong> 2</p>
<p><strong>Explanation:</strong> String can be “mbdadbm” or “mdbabdm”.</p>
<p><strong>Example 3:</strong></p>
<p><strong>Input:</strong> s = “leetcode”</p>
<p><strong>Output:</strong> 5</p>
<p><strong>Explanation:</strong> Inserting 5 characters the string becomes “leetcodocteel”.</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>1 <= s.length <= 500</code></li>
<li><code>s</code> consists of lowercase English letters.</li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
minInsertions
-