1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-24 22:38:57 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-03-29 16:56:27 +08:00
parent e730aa6794
commit ad15da05aa
2517 changed files with 7358 additions and 7332 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>一个 2D 网格中的 <strong>顶峰元素 </strong>是指那些 <strong>严格大于 </strong>其相邻格子(上、下、左、右)的元素。</p>\n\n<p>给你一个<strong> 从 0 开始编号 </strong>的 <code>m x n</code> 矩阵 <code>mat</code> ,其中任意两个相邻格子的值都<strong> 不相同</strong> 。找出 <strong>任意一个 </strong>顶峰元素 <code>mat[i][j]</code> 并 <strong>返回其位置 </strong><code>[i,j]</code> 。</p>\n\n<p>你可以假设整个矩阵周边环绕着一圈值为 <code>-1</code> 的格子。</p>\n\n<p>要求必须写出时间复杂度为 <code>O(m log(n))</code> 或 <code>O(n log(m))</code> 的算法</p>\n\n<p> </p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode.com/uploads/2021/06/08/1.png\" style=\"width: 206px; height: 209px;\" /></p>\n\n<pre>\n<strong>输入:</strong> mat = [[1,4],[3,2]]\n<strong>输出:</strong> [0,1]\n<strong>解释:</strong> 3和4都是顶峰元素所以[1,0]和[0,1]都是可接受的答案。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<p><strong><img alt=\"\" src=\"https://assets.leetcode.com/uploads/2021/06/07/3.png\" style=\"width: 254px; height: 257px;\" /></strong></p>\n\n<pre>\n<strong>输入:</strong> mat = [[10,20,15],[21,30,14],[7,16,32]]\n<strong>输出:</strong> [1,1]\n<strong>解释:</strong> 30和32都是顶峰元素所以[1,1]和[2,2]都是可接受的答案。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>m == mat.length</code></li>\n\t<li><code>n == mat[i].length</code></li>\n\t<li><code>1 <= m, n <= 500</code></li>\n\t<li><code>1 <= mat[i][j] <= 10<sup>5</sup></code></li>\n\t<li>任意两个相邻元素均不相等.</li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 26,
"likes": 27,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -155,7 +155,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"2.7K\", \"totalSubmission\": \"4.6K\", \"totalAcceptedRaw\": 2714, \"totalSubmissionRaw\": 4622, \"acRate\": \"58.7%\"}",
"stats": "{\"totalAccepted\": \"2.7K\", \"totalSubmission\": \"4.7K\", \"totalAcceptedRaw\": 2744, \"totalSubmissionRaw\": 4678, \"acRate\": \"58.7%\"}",
"hints": [
"Let's assume that the width of the array is bigger than the height, otherwise, we will split in another direction.",
"Split the array into three parts: central column left side and right side.",