1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-03 06:22:54 +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>给你一个奇怪的打印机,它有如下两个特殊的打印规则:</p>\n\n<ul>\n\t<li>每一次操作时,打印机会用同一种颜色打印一个矩形的形状,每次打印会覆盖矩形对应格子里原本的颜色。</li>\n\t<li>一旦矩形根据上面的规则使用了一种颜色,那么 <strong>相同的颜色不能再被使用&nbsp;</strong>。</li>\n</ul>\n\n<p>给你一个初始没有颜色的&nbsp;<code>m x n</code>&nbsp;的矩形&nbsp;<code>targetGrid</code>&nbsp;,其中&nbsp;<code>targetGrid[row][col]</code>&nbsp;是位置&nbsp;<code>(row, col)</code>&nbsp;的颜色。</p>\n\n<p>如果你能按照上述规则打印出矩形<em>&nbsp;</em><code>targetGrid</code>&nbsp;,请你返回&nbsp;<code>true</code>&nbsp;,否则返回&nbsp;<code>false</code>&nbsp;。</p>\n\n<p>&nbsp;</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>&nbsp;</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 &lt;= m, n &lt;= 60</code></li>\n\t<li><code>1 &lt;= targetGrid[row][col] &lt;= 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?"
],