mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
33 lines
1.1 KiB
HTML
33 lines
1.1 KiB
HTML
<p>仓库管理员以数组 <code>stock</code> 形式记录商品库存表。<code>stock[i]</code> 表示商品 <code>id</code>,可能存在重复。原库存表按商品 <code>id</code> 升序排列。现因突发情况需要进行商品紧急调拨,管理员将这批商品 <code>id</code> 提前依次整理至库存表最后。请你找到并返回库存表中编号的 <strong>最小的元素</strong> 以便及时记录本次调拨。</p>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>示例 1:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>stock =<strong> </strong>[4,5,8,3,4]
|
||
<strong>输出:</strong>3
|
||
</pre>
|
||
|
||
<p><strong>示例 2:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>stock = [5,7,9,1,2]
|
||
<strong>输出:</strong>1
|
||
</pre>
|
||
|
||
<p> </p>
|
||
|
||
<p>提示:</p>
|
||
|
||
<ul>
|
||
<li>1 <= stock.length <= 5000</li>
|
||
<li>-5000 <= stock[i] <= 5000</li>
|
||
</ul>
|
||
|
||
<p> </p>
|
||
|
||
<p>注意:本题与主站 154 题相同:<a href="https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array-ii/">https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array-ii/</a></p>
|
||
|
||
<p> </p>
|