mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-04 23:11:41 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个下标从<strong> 0</strong> 开始的 <strong>二进制</strong> 字符串 <code>floor</code> ,它表示地板上砖块的颜色。</p>\n\n<ul>\n\t<li><code>floor[i] = '0'</code> 表示地板上第 <code>i</code> 块砖块的颜色是 <strong>黑色</strong> 。</li>\n\t<li><code>floor[i] = '1'</code> 表示地板上第 <code>i</code> 块砖块的颜色是 <strong>白色</strong> 。</li>\n</ul>\n\n<p>同时给你 <code>numCarpets</code> 和 <code>carpetLen</code> 。你有 <code>numCarpets</code> 条 <strong>黑色</strong> 的地毯,每一条 <strong>黑色</strong> 的地毯长度都为 <code>carpetLen</code> 块砖块。请你使用这些地毯去覆盖砖块,使得未被覆盖的剩余 <strong>白色</strong> 砖块的数目 <strong>最小</strong> 。地毯相互之间可以覆盖。</p>\n\n<p>请你返回没被覆盖的白色砖块的 <strong>最少</strong> 数目。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode.com/uploads/2022/02/10/ex1-1.png\" style=\"width: 400px; height: 73px;\"></p>\n\n<pre><b>输入:</b>floor = \"10110101\", numCarpets = 2, carpetLen = 2\n<b>输出:</b>2\n<b>解释:</b>\n上图展示了剩余 2 块白色砖块的方案。\n没有其他方案可以使未被覆盖的白色砖块少于 2 块。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode.com/uploads/2022/02/10/ex2.png\" style=\"width: 353px; height: 123px;\"></p>\n\n<pre><b>输入:</b>floor = \"11111\", numCarpets = 2, carpetLen = 3\n<b>输出:</b>0\n<b>解释:</b>\n上图展示了所有白色砖块都被覆盖的一种方案。\n注意,地毯相互之间可以覆盖。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= carpetLen <= floor.length <= 1000</code></li>\n\t<li><code>floor[i]</code> 要么是 <code>'0'</code> ,要么是 <code>'1'</code> 。</li>\n\t<li><code>1 <= numCarpets <= 1000</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 22,
|
||||
"likes": 23,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -149,7 +149,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"2.9K\", \"totalSubmission\": \"8.5K\", \"totalAcceptedRaw\": 2887, \"totalSubmissionRaw\": 8517, \"acRate\": \"33.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"3.2K\", \"totalSubmission\": \"9.1K\", \"totalAcceptedRaw\": 3213, \"totalSubmissionRaw\": 9123, \"acRate\": \"35.2%\"}",
|
||||
"hints": [
|
||||
"Can you think of a DP solution?",
|
||||
"Let DP[i][j] denote the minimum number of white tiles still visible from indices i to floor.length-1 after covering with at most j carpets.",
|
||||
|
Reference in New Issue
Block a user