mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-02 14:12:17 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个由小写字母组成的字符串 <code>s</code>,和一个整数 <code>k</code>。</p>\n\n<p>请你按下面的要求分割字符串:</p>\n\n<ul>\n\t<li>首先,你可以将 <code>s</code> 中的部分字符修改为其他的小写英文字母。</li>\n\t<li>接着,你需要把 <code>s</code> 分割成 <code>k</code> 个非空且不相交的子串,并且每个子串都是回文串。</li>\n</ul>\n\n<p>请返回以这种方式分割字符串所需修改的最少字符数。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre><strong>输入:</strong>s = "abc", k = 2\n<strong>输出:</strong>1\n<strong>解释:</strong>你可以把字符串分割成 "ab" 和 "c",并修改 "ab" 中的 1 个字符,将它变成回文串。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre><strong>输入:</strong>s = "aabbc", k = 3\n<strong>输出:</strong>0\n<strong>解释:</strong>你可以把字符串分割成 "aa"、"bb" 和 "c",它们都是回文串。</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre><strong>输入:</strong>s = "leetcode", k = 8\n<strong>输出:</strong>0\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= k <= s.length <= 100</code></li>\n\t<li><code>s</code> 中只含有小写英文字母。</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 96,
|
||||
"likes": 101,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"4.4K\", \"totalSubmission\": \"7.1K\", \"totalAcceptedRaw\": 4359, \"totalSubmissionRaw\": 7144, \"acRate\": \"61.0%\"}",
|
||||
"stats": "{\"totalAccepted\": \"4.5K\", \"totalSubmission\": \"7.4K\", \"totalAcceptedRaw\": 4498, \"totalSubmissionRaw\": 7382, \"acRate\": \"60.9%\"}",
|
||||
"hints": [
|
||||
"For each substring calculate the minimum number of steps to make it palindrome and store it in a table.",
|
||||
"Create a dp(pos, cnt) which means the minimum number of characters changed for the suffix of s starting on pos splitting the suffix on cnt chunks."
|
||||
|
Reference in New Issue
Block a user