mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-07 00:11:41 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>编写函数,实现许多图片编辑软件都支持的「颜色填充」功能。</p>\n\n<p>待填充的图像用二维数组 <code>image</code> 表示,元素为初始颜色值。初始坐标点的行坐标为 <code>sr</code> 列坐标为 <code>sc</code>。需要填充的新颜色为 <code>newColor</code> 。</p>\n\n<p>「周围区域」是指颜色相同且在上、下、左、右四个方向上存在相连情况的若干元素。</p>\n\n<p>请用新颜色填充初始坐标点的周围区域,并返回填充后的图像。</p>\n\n<p> </p>\n\n<p><strong>示例:</strong></p>\n\n<pre>\n<strong>输入</strong>:\nimage = [[1,1,1],[1,1,0],[1,0,1]] \nsr = 1, sc = 1, newColor = 2\n<strong>输出</strong>:[[2,2,2],[2,2,0],[2,0,1]]\n<strong>解释</strong>: \n初始坐标点位于图像的正中间,坐标 (sr,sc)=(1,1) 。\n初始坐标点周围区域上所有符合条件的像素点的颜色都被更改成 2 。\n注意,右下角的像素没有更改为 2 ,因为它不属于初始坐标点的周围区域。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>image</code> 和 <code>image[0]</code> 的长度均在范围 [1, 50] 内。</li>\n\t<li>初始坐标点 <code>(sr,sc)</code> 满足 <code>0 <= sr < image.length</code> 和 <code>0 <= sc < image[0].length</code> 。</li>\n\t<li><code>image[i][j]</code> 和 <code>newColor</code> 表示的颜色值在范围 <code>[0, 65535]</code> 内。</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 46,
|
||||
"likes": 49,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -155,7 +155,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"16.7K\", \"totalSubmission\": \"29.9K\", \"totalAcceptedRaw\": 16736, \"totalSubmissionRaw\": 29925, \"acRate\": \"55.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"17.3K\", \"totalSubmission\": \"31.1K\", \"totalAcceptedRaw\": 17334, \"totalSubmissionRaw\": 31103, \"acRate\": \"55.7%\"}",
|
||||
"hints": [
|
||||
"把这个看成一个图。",
|
||||
"你可以使用深度优先搜索(或广度优先搜索)。“正确”颜色的每个相邻像素都是一个连接边。"
|
||||
|
Reference in New Issue
Block a user