mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-03 06:22:54 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个奇怪的打印机,它有如下两个特殊的打印规则:</p>\n\n<ul>\n\t<li>每一次操作时,打印机会用同一种颜色打印一个矩形的形状,每次打印会覆盖矩形对应格子里原本的颜色。</li>\n\t<li>一旦矩形根据上面的规则使用了一种颜色,那么 <strong>相同的颜色不能再被使用 </strong>。</li>\n</ul>\n\n<p>给你一个初始没有颜色的 <code>m x n</code> 的矩形 <code>targetGrid</code> ,其中 <code>targetGrid[row][col]</code> 是位置 <code>(row, col)</code> 的颜色。</p>\n\n<p>如果你能按照上述规则打印出矩形<em> </em><code>targetGrid</code> ,请你返回 <code>true</code> ,否则返回 <code>false</code> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/09/19/sample_1_1929.png\" style=\"height: 138px; width: 483px;\"></p>\n\n<pre><strong>输入:</strong>targetGrid = [[1,1,1,1],[1,2,2,1],[1,2,2,1],[1,1,1,1]]\n<strong>输出:</strong>true\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/09/19/sample_2_1929.png\" style=\"height: 290px; width: 483px;\"></p>\n\n<pre><strong>输入:</strong>targetGrid = [[1,1,1,1],[1,1,3,3],[1,1,3,4],[5,5,1,4]]\n<strong>输出:</strong>true\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre><strong>输入:</strong>targetGrid = [[1,2,1],[2,1,2],[1,2,1]]\n<strong>输出:</strong>false\n<strong>解释:</strong>没有办法得到 targetGrid ,因为每一轮操作使用的颜色互不相同。</pre>\n\n<p><strong>示例 4:</strong></p>\n\n<pre><strong>输入:</strong>targetGrid = [[1,1,1],[3,1,3]]\n<strong>输出:</strong>false\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>m == targetGrid.length</code></li>\n\t<li><code>n == targetGrid[i].length</code></li>\n\t<li><code>1 <= m, n <= 60</code></li>\n\t<li><code>1 <= targetGrid[row][col] <= 60</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 26,
|
||||
"likes": 27,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -155,7 +155,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"1.5K\", \"totalSubmission\": \"2.4K\", \"totalAcceptedRaw\": 1459, \"totalSubmissionRaw\": 2432, \"acRate\": \"60.0%\"}",
|
||||
"stats": "{\"totalAccepted\": \"1.5K\", \"totalSubmission\": \"2.5K\", \"totalAcceptedRaw\": 1502, \"totalSubmissionRaw\": 2506, \"acRate\": \"59.9%\"}",
|
||||
"hints": [
|
||||
"Try thinking in reverse. Given the grid, how can you tell if a colour was painted last?"
|
||||
],
|
||||
|
Reference in New Issue
Block a user