1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-09 01:11:42 +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>给定四个整数 <code>row</code>&nbsp;,&nbsp; &nbsp;<code>cols</code> ,&nbsp; <code>rCenter</code> 和 <code>cCenter</code> 。有一个&nbsp;<code>rows x cols</code>&nbsp;的矩阵,你在单元格上的坐标是&nbsp;<code>(rCenter, cCenter)</code> 。</p>\n\n<p>返回矩阵中的所有单元格的坐标,并按与<em>&nbsp;</em><code>(rCenter, cCenter)</code><em>&nbsp;</em>的 <strong>距离</strong> 从最小到最大的顺序排。你可以按 <strong>任何</strong> 满足此条件的顺序返回答案。</p>\n\n<p>单元格<code>(r1, c1)</code> 和 <code>(r2, c2)</code> 之间的距离为<code>|r1 - r2| + |c1 - c2|</code>。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>rows = 1, cols = 2, rCenter = 0, cCenter = 0\n<strong>输出:</strong>[[0,0],[0,1]]\n<strong>解释</strong>:从 (r0, c0) 到其他单元格的距离为:[0,1]\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>rows = 2, cols = 2, rCenter = 0, cCenter = 1\n<strong>输出:</strong>[[0,1],[0,0],[1,1],[1,0]]\n<strong>解释</strong>:从 (r0, c0) 到其他单元格的距离为:[0,1,1,2]\n[[0,1],[1,1],[0,0],[1,0]] 也会被视作正确答案。\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<strong>输入:</strong>rows = 2, cols = 3, rCenter = 1, cCenter = 2\n<strong>输出:</strong>[[1,2],[0,2],[1,1],[0,1],[1,0],[0,0]]\n<strong>解释</strong>:从 (r0, c0) 到其他单元格的距离为:[0,1,1,2,2,3]\n其他满足题目要求的答案也会被视为正确例如 [[1,2],[1,1],[0,2],[1,0],[0,1],[0,0]]。\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= rows, cols &lt;= 100</code></li>\n\t<li><code>0 &lt;= rCenter &lt; rows</code></li>\n\t<li><code>0 &lt;= cCenter &lt; cols</code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 123,
"likes": 127,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -161,7 +161,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"42.6K\", \"totalSubmission\": \"60K\", \"totalAcceptedRaw\": 42563, \"totalSubmissionRaw\": 60014, \"acRate\": \"70.9%\"}",
"stats": "{\"totalAccepted\": \"43K\", \"totalSubmission\": \"60.7K\", \"totalAcceptedRaw\": 43045, \"totalSubmissionRaw\": 60705, \"acRate\": \"70.9%\"}",
"hints": [],
"solution": null,
"status": null,