mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-18 11:36:48 +08:00
更新国内版力扣题目描述变更
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
<p>In an array of integers, a "peak" is an element which is greater than or equal to the adjacent integers and a "valley" is an element which is less than or equal to the adjacent inte­gers. For example, in the array {5, 8, 4, 2, 3, 4, 6}, {8, 6} are peaks and {5, 2} are valleys. Given an array of integers, sort the array into an alternating sequence of peaks and valleys.</p>
|
||||
|
||||
<p><strong>Example:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input: </strong>[5, 3, 1, 2, 3]
|
||||
<strong>Output:</strong> [5, 1, 3, 2, 3]
|
||||
</pre>
|
||||
|
||||
<p><strong>Note: </strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>nums.length <= 10000</code></li>
|
||||
</ul>
|
||||
<p>In an array of integers, a "peak" is an element which is greater than or equal to the adjacent integers and a "valley" is an element which is less than or equal to the adjacent inte­gers. For example, in the array {5, 8, 4, 2, 3, 4, 6}, {8, 6} are peaks and {5, 2} are valleys. Given an array of integers, sort the array into an alternating sequence of peaks and valleys.</p>
|
||||
|
||||
|
||||
|
||||
<p><strong>Example:</strong></p>
|
||||
|
||||
|
||||
|
||||
<pre>
|
||||
|
||||
<strong>Input: </strong>[5, 3, 1, 2, 3]
|
||||
|
||||
<strong>Output:</strong> [5, 1, 3, 2, 3]
|
||||
|
||||
|
Reference in New Issue
Block a user