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>arr</code> ,返回 <code>arr</code> 的 <em>最大湍流子数组的<strong>长度</strong></em><strong> </strong>。</p>\n\n<p>如果比较符号在子数组中的每个相邻元素对之间翻转,则该子数组是 <strong>湍流子数组</strong> 。</p>\n\n<p>更正式地来说,当 <code>arr</code> 的子数组 <code>A[i], A[i+1], ..., A[j]</code> 满足仅满足下列条件时,我们称其为<em>湍流子数组</em>:</p>\n\n<ul>\n\t<li>若 <code>i <= k < j</code> :\n\n\t<ul>\n\t\t<li>当 <code>k</code> 为奇数时, <code>A[k] > A[k+1]</code>,且</li>\n\t\t<li>当 <code>k</code> 为偶数时,<code>A[k] < A[k+1]</code>;</li>\n\t</ul>\n\t</li>\n\t<li><strong>或 </strong>若 <code>i <= k < j</code> :\n\t<ul>\n\t\t<li>当 <code>k</code> 为偶数时,<code>A[k] > A[k+1]</code> ,且</li>\n\t\t<li>当 <code>k</code> 为奇数时, <code>A[k] < A[k+1]</code>。</li>\n\t</ul>\n\t</li>\n</ul>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>arr = [9,4,2,10,7,8,8,1,9]\n<strong>输出:</strong>5\n<strong>解释:</strong>arr[1] > arr[2] < arr[3] > arr[4] < arr[5]</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>arr = [4,8,12,16]\n<strong>输出:</strong>2\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>arr = [100]\n<strong>输出:</strong>1\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= arr.length <= 4 * 10<sup>4</sup></code></li>\n\t<li><code>0 <= arr[i] <= 10<sup>9</sup></code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 195,
|
||||
"likes": 197,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Maximum Subarray\", \"titleSlug\": \"maximum-subarray\", \"difficulty\": \"Easy\", \"translatedTitle\": \"\\u6700\\u5927\\u5b50\\u6570\\u7ec4\\u548c\"}]",
|
||||
@@ -149,7 +149,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"45.6K\", \"totalSubmission\": \"96.5K\", \"totalAcceptedRaw\": 45634, \"totalSubmissionRaw\": 96467, \"acRate\": \"47.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"46.1K\", \"totalSubmission\": \"97.4K\", \"totalAcceptedRaw\": 46073, \"totalSubmissionRaw\": 97409, \"acRate\": \"47.3%\"}",
|
||||
"hints": [],
|
||||
"solution": {
|
||||
"id": "124",
|
||||
|
Reference in New Issue
Block a user