mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-03 06:22:54 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个整数数组 <code>arr</code>,如果它是有效的山脉数组就返回 <code>true</code>,否则返回 <code>false</code>。</p>\n\n<p>让我们回顾一下,如果 <code>arr</code> 满足下述条件,那么它是一个山脉数组:</p>\n\n<ul>\n\t<li><code>arr.length >= 3</code></li>\n\t<li>在 <code>0 < i < arr.length - 1</code> 条件下,存在 <code>i</code> 使得:\n\t<ul>\n\t\t<li><code>arr[0] < arr[1] < ... arr[i-1] < arr[i] </code></li>\n\t\t<li><code>arr[i] > arr[i+1] > ... > arr[arr.length - 1]</code></li>\n\t</ul>\n\t</li>\n</ul>\n\n<p> </p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode.com/uploads/2019/10/20/hint_valid_mountain_array.png\" style=\"height: 316px; width: 500px;\" /></p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>arr = [2,1]\n<strong>输出:</strong>false\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>arr = [3,5,5]\n<strong>输出:</strong>false\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>arr = [0,3,2,1]\n<strong>输出:</strong>true</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= arr.length <= 10<sup>4</sup></code></li>\n\t<li><code>0 <= arr[i] <= 10<sup>4</sup></code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 171,
|
||||
"likes": 173,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -137,7 +137,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"65.9K\", \"totalSubmission\": \"167.6K\", \"totalAcceptedRaw\": 65889, \"totalSubmissionRaw\": 167596, \"acRate\": \"39.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"66.6K\", \"totalSubmission\": \"169.4K\", \"totalAcceptedRaw\": 66613, \"totalSubmissionRaw\": 169409, \"acRate\": \"39.3%\"}",
|
||||
"hints": [
|
||||
"It's very easy to keep track of a monotonically increasing or decreasing ordering of elements. You just need to be able to determine the start of the valley in the mountain and from that point onwards, it should be a valley i.e. no mini-hills after that. Use this information in regards to the values in the array and you will be able to come up with a straightforward solution."
|
||||
],
|
||||
|
Reference in New Issue
Block a user