1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-22 13:36:46 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>给你一个字符串&nbsp;<code>s</code>&nbsp;,每一次操作你都可以在字符串的任意位置插入任意字符。</p>\n\n<p>请你返回让&nbsp;<code>s</code>&nbsp;成为回文串的&nbsp;<strong>最少操作次数</strong>&nbsp;。</p>\n\n<p>「回文串」是正读和反读都相同的字符串。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"zzazz\"\n<strong>输出:</strong>0\n<strong>解释:</strong>字符串 \"zzazz\" 已经是回文串了,所以不需要做任何插入操作。\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"mbadm\"\n<strong>输出:</strong>2\n<strong>解释:</strong>字符串可变为 \"mbdadbm\" 或者 \"mdbabdm\" 。\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"leetcode\"\n<strong>输出:</strong>5\n<strong>解释:</strong>插入 5 个字符后字符串变为 \"leetcodocteel\" 。\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= s.length &lt;= 500</code></li>\n\t<li><code>s</code>&nbsp;中所有字符都是小写字母。</li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Hard",
"likes": 130,
"likes": 135,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -143,7 +143,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"13.5K\", \"totalSubmission\": \"20K\", \"totalAcceptedRaw\": 13541, \"totalSubmissionRaw\": 19986, \"acRate\": \"67.8%\"}",
"stats": "{\"totalAccepted\": \"14.5K\", \"totalSubmission\": \"21.5K\", \"totalAcceptedRaw\": 14517, \"totalSubmissionRaw\": 21487, \"acRate\": \"67.6%\"}",
"hints": [
"Is dynamic programming suitable for this problem ?",
"If we know the longest palindromic sub-sequence is x and the length of the string is n then, what is the answer to this problem? It is n - x as we need n - x insertions to make the remaining characters also palindrome."