1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-07 00:11:41 +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>arr</code>&nbsp;,返回 <code>arr</code>&nbsp;的&nbsp;<em>最大湍流子数组的<strong>长度</strong></em><strong>&nbsp;</strong>。</p>\n\n<p>如果比较符号在子数组中的每个相邻元素对之间翻转,则该子数组是&nbsp;<strong>湍流子数组</strong>&nbsp;。</p>\n\n<p>更正式地来说,当 <code>arr</code>&nbsp;的子数组&nbsp;<code>A[i], A[i+1], ..., A[j]</code>&nbsp;满足仅满足下列条件时,我们称其为<em>湍流子数组</em></p>\n\n<ul>\n\t<li>若&nbsp;<code>i &lt;= k &lt; j</code>&nbsp;\n\n\t<ul>\n\t\t<li>当 <code>k</code>&nbsp;为奇数时,&nbsp;<code>A[k] &gt; A[k+1]</code>,且</li>\n\t\t<li>当 <code>k</code> 为偶数时,<code>A[k] &lt; A[k+1]</code></li>\n\t</ul>\n\t</li>\n\t<li><strong>或 </strong>若&nbsp;<code>i &lt;= k &lt; j</code>&nbsp;\n\t<ul>\n\t\t<li>当 <code>k</code> 为偶数时,<code>A[k] &gt; A[k+1]</code>&nbsp;,且</li>\n\t\t<li>当 <code>k</code>&nbsp;为奇数时,&nbsp;<code>A[k] &lt; A[k+1]</code>。</li>\n\t</ul>\n\t</li>\n</ul>\n\n<p>&nbsp;</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] &gt; arr[2] &lt; arr[3] &gt; arr[4] &lt; 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>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= arr.length &lt;= 4 * 10<sup>4</sup></code></li>\n\t<li><code>0 &lt;= arr[i] &lt;= 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",