1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-13 01:15:14 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2025-09-29 14:43:44 +08:00
parent 2862a227c4
commit 13f2098086
4409 changed files with 168933 additions and 166256 deletions

View File

@@ -1,9 +1,10 @@
<p>在一个整数数组中,&ldquo;&rdquo;是大于或等于相邻整数的元素,相应地,&ldquo;&rdquo;是小于或等于相邻整数的元素。例如,在数组{5, 8, 4, 2, 3, 4, 6}中,{8, 6}是峰, {5, 2}是谷。现在给定一个整数数组,将该数组按峰与谷的交替顺序排序。</p>
<p>在一个整数数组中,“峰”是大于或等于相邻整数的元素,相应地,“谷”是小于或等于相邻整数的元素。例如,在数组{5, 8, 4, 2, 3, 4, 6}中,{8, 6}是峰, {5, 2}是谷。现在给定一个整数数组,将该数组按峰与谷的交替顺序排序。</p>
<p><strong>示例:</strong></p>
<p><strong>示例</strong></p>
<pre><strong>输入: </strong>[5, 3, 1, 2, 3]
<strong>出:</strong>&nbsp;[5, 1, 3, 2, 3]
<pre>
<strong>入:</strong>[5, 3, 1, 2, 3]
<strong>输出:</strong>[5, 1, 3, 2, 3]
</pre>
<p><strong>提示:</strong></p>