mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-08 17:01:42 +08:00
移除零宽空格
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
"titleSlug": "largest-plus-sign",
|
||||
"content": "<p>You are given an integer <code>n</code>. You have an <code>n x n</code> binary grid <code>grid</code> with all values initially <code>1</code>'s except for some indices given in the array <code>mines</code>. The <code>i<sup>th</sup></code> element of the array <code>mines</code> is defined as <code>mines[i] = [x<sub>i</sub>, y<sub>i</sub>]</code> where <code>grid[x<sub>i</sub>][y<sub>i</sub>] == 0</code>.</p>\n\n<p>Return <em>the order of the largest <strong>axis-aligned</strong> plus sign of </em>1<em>'s contained in </em><code>grid</code>. If there is none, return <code>0</code>.</p>\n\n<p>An <strong>axis-aligned plus sign</strong> of <code>1</code>'s of order <code>k</code> has some center <code>grid[r][c] == 1</code> along with four arms of length <code>k - 1</code> going up, down, left, and right, and made of <code>1</code>'s. Note that there could be <code>0</code>'s or <code>1</code>'s beyond the arms of the plus sign, only the relevant area of the plus sign is checked for <code>1</code>'s.</p>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n<img alt=\"\" src=\"https://assets.leetcode.com/uploads/2021/06/13/plus1-grid.jpg\" style=\"width: 404px; height: 405px;\" />\n<pre>\n<strong>Input:</strong> n = 5, mines = [[4,2]]\n<strong>Output:</strong> 2\n<strong>Explanation:</strong> In the above grid, the largest plus sign can only be of order 2. One of them is shown.\n</pre>\n\n<p><strong class=\"example\">Example 2:</strong></p>\n<img alt=\"\" src=\"https://assets.leetcode.com/uploads/2021/06/13/plus2-grid.jpg\" style=\"width: 84px; height: 85px;\" />\n<pre>\n<strong>Input:</strong> n = 1, mines = [[0,0]]\n<strong>Output:</strong> 0\n<strong>Explanation:</strong> There is no plus sign, so return 0.\n</pre>\n\n<p> </p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>1 <= n <= 500</code></li>\n\t<li><code>1 <= mines.length <= 5000</code></li>\n\t<li><code>0 <= x<sub>i</sub>, y<sub>i</sub> < n</code></li>\n\t<li>All the pairs <code>(x<sub>i</sub>, y<sub>i</sub>)</code> are <strong>unique</strong>.</li>\n</ul>\n",
|
||||
"translatedTitle": "最大加号标志",
|
||||
"translatedContent": "<p>在一个 <code>n x n</code> 的矩阵 <code>grid</code> 中,除了在数组 <code>mines</code> 中给出的元素为 <code>0</code>,其他每个元素都为 <code>1</code>。<code>mines[i] = [x<sub>i</sub>, y<sub>i</sub>]</code>表示 <code>grid[x<sub>i</sub>][y<sub>i</sub>] == 0</code></p>\n\n<p>返回 <em> </em><code>grid</code><em> 中包含 <code>1</code> 的最大的 <strong>轴对齐</strong> 加号标志的阶数</em> 。如果未找到加号标志,则返回 <code>0</code> 。</p>\n\n<p>一个 <code>k</code> 阶由 <em><code>1</code></em> 组成的 <strong>“轴对称”加号标志</strong> 具有中心网格 <code>grid[r][c] == 1</code> ,以及4个从中心向上、向下、向左、向右延伸,长度为 <code>k-1</code>,由 <code>1</code> 组成的臂。注意,只有加号标志的所有网格要求为 <code>1</code> ,别的网格可能为 <code>0</code> 也可能为 <code>1</code> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img src=\"https://assets.leetcode.com/uploads/2021/06/13/plus1-grid.jpg\" /></p>\n\n<pre>\n<strong>输入:</strong> n = 5, mines = [[4, 2]]\n<strong>输出:</strong> 2\n<strong>解释: </strong>在上面的网格中,最大加号标志的阶只能是2。一个标志已在图中标出。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<p><img src=\"https://assets.leetcode.com/uploads/2021/06/13/plus2-grid.jpg\" /></p>\n\n<pre>\n<strong>输入:</strong> n = 1, mines = [[0, 0]]\n<strong>输出:</strong> 0\n<strong>解释: </strong>没有加号标志,返回 0 。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= n <= 500</code></li>\n\t<li><code>1 <= mines.length <= 5000</code></li>\n\t<li><code>0 <= x<sub>i</sub>, y<sub>i</sub> < n</code></li>\n\t<li>每一对 <code>(x<sub>i</sub>, y<sub>i</sub>)</code> 都 <strong>不重复</strong></li>\n</ul>\n",
|
||||
"translatedContent": "<p>在一个 <code>n x n</code> 的矩阵 <code>grid</code> 中,除了在数组 <code>mines</code> 中给出的元素为 <code>0</code>,其他每个元素都为 <code>1</code>。<code>mines[i] = [x<sub>i</sub>, y<sub>i</sub>]</code>表示 <code>grid[x<sub>i</sub>][y<sub>i</sub>] == 0</code></p>\n\n<p>返回 <em> </em><code>grid</code><em> 中包含 <code>1</code> 的最大的 <strong>轴对齐</strong> 加号标志的阶数</em> 。如果未找到加号标志,则返回 <code>0</code> 。</p>\n\n<p>一个 <code>k</code> 阶由 <em><code>1</code></em> 组成的 <strong>“轴对称”加号标志</strong> 具有中心网格 <code>grid[r][c] == 1</code> ,以及4个从中心向上、向下、向左、向右延伸,长度为 <code>k-1</code>,由 <code>1</code> 组成的臂。注意,只有加号标志的所有网格要求为 <code>1</code> ,别的网格可能为 <code>0</code> 也可能为 <code>1</code> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img src=\"https://assets.leetcode.com/uploads/2021/06/13/plus1-grid.jpg\" /></p>\n\n<pre>\n<strong>输入:</strong> n = 5, mines = [[4, 2]]\n<strong>输出:</strong> 2\n<strong>解释: </strong>在上面的网格中,最大加号标志的阶只能是2。一个标志已在图中标出。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<p><img src=\"https://assets.leetcode.com/uploads/2021/06/13/plus2-grid.jpg\" /></p>\n\n<pre>\n<strong>输入:</strong> n = 1, mines = [[0, 0]]\n<strong>输出:</strong> 0\n<strong>解释: </strong>没有加号标志,返回 0 。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= n <= 500</code></li>\n\t<li><code>1 <= mines.length <= 5000</code></li>\n\t<li><code>0 <= x<sub>i</sub>, y<sub>i</sub> < n</code></li>\n\t<li>每一对 <code>(x<sub>i</sub>, y<sub>i</sub>)</code> 都 <strong>不重复</strong></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 224,
|
||||
|
Reference in New Issue
Block a user