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>二维矩阵 <code>grid</code> 由 <code>0</code> (土地)和 <code>1</code> (水)组成。岛是由最大的4个方向连通的 <code>0</code> 组成的群,封闭岛是一个 <code>完全</code> 由1包围(左、上、右、下)的岛。</p>\n\n<p>请返回 <em>封闭岛屿</em> 的数目。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode.com/uploads/2019/10/31/sample_3_1610.png\" style=\"height: 151px; width: 240px;\" /></p>\n\n<pre>\n<strong>输入:</strong>grid = [[1,1,1,1,1,1,1,0],[1,0,0,0,0,1,1,0],[1,0,1,0,1,1,1,0],[1,0,0,0,0,1,0,1],[1,1,1,1,1,1,1,0]]\n<strong>输出:</strong>2\n<strong>解释:</strong>\n灰色区域的岛屿是封闭岛屿,因为这座岛屿完全被水域包围(即被 1 区域包围)。</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<p><img src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2019/11/07/sample_4_1610.png\" style=\"height: 98px; width: 160px;\" /></p>\n\n<pre>\n<strong>输入:</strong>grid = [[0,0,1,0,0],[0,1,0,1,0],[0,1,1,1,0]]\n<strong>输出:</strong>1\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>grid = [[1,1,1,1,1,1,1],\n [1,0,0,0,0,0,1],\n [1,0,1,1,1,0,1],\n [1,0,1,0,1,0,1],\n [1,0,1,1,1,0,1],\n [1,0,0,0,0,0,1],\n [1,1,1,1,1,1,1]]\n<strong>输出:</strong>2\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= grid.length, grid[0].length <= 100</code></li>\n\t<li><code>0 <= grid[i][j] <=1</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 123,
|
||||
"likes": 128,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -161,7 +161,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"22.4K\", \"totalSubmission\": \"36.4K\", \"totalAcceptedRaw\": 22354, \"totalSubmissionRaw\": 36429, \"acRate\": \"61.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"24.7K\", \"totalSubmission\": \"40K\", \"totalAcceptedRaw\": 24656, \"totalSubmissionRaw\": 40021, \"acRate\": \"61.6%\"}",
|
||||
"hints": [
|
||||
"Exclude connected group of 0s on the corners because they are not closed island.",
|
||||
"Return number of connected component of 0s on the grid."
|
||||
|
Reference in New Issue
Block a user