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)/库存管理 II [shu-zu-zhong-chu-xian-ci-shu-chao-guo-yi-ban-de-shu-zi-lcof].html
2023-12-09 18:53:53 +08:00

23 lines
755 B
HTML

<p>仓库管理员以数组 <code>stock</code> 形式记录商品库存表。<code>stock[i]</code> 表示商品 <code>id</code>,可能存在重复。请返回库存表中数量大于 <code>stock.length / 2</code> 的商品 <code>id</code></p>
<p>&nbsp;</p>
<p><strong>示例&nbsp;1:</strong></p>
<pre>
<strong>输入: </strong>stock = [6, 1, 3, 1, 1, 1]
<strong>输出: </strong>1</pre>
<p>&nbsp;</p>
<p><strong>限制:</strong></p>
<ul>
<li><code>1 &lt;= stock.length &lt;= 50000</code></li>
<li>给定数组为非空数组,且存在结果数字</li>
</ul>
<p>&nbsp;</p>
<p>注意:本题与主站 169 题相同:<a href="https://leetcode-cn.com/problems/majority-element/">https://leetcode-cn.com/problems/majority-element/</a></p>