1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/库存管理 III [zui-xiao-de-kge-shu-lcof].html
2023-12-09 18:53:53 +08:00

28 lines
727 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>仓库管理员以数组 <code>stock</code> 形式记录商品库存表,其中 <code>stock[i]</code> 表示对应商品库存余量。请返回库存余量最少的 <code>cnt</code> 个商品余量,返回&nbsp;<strong>顺序不限</strong></p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>stock = [2,5,7,4], cnt = 1
<strong>输出:</strong>[2]
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>stock = [0,2,3,6], cnt = 2
<strong>输出:</strong>[0,2] 或 [2,0]</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>0 &lt;= cnt &lt;= stock.length &lt;= 10000<br />
0 &lt;= stock[i] &lt;= 10000</code></li>
</ul>
<p>&nbsp;</p>