1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/最小K个数 [smallest-k-lcci].html

15 lines
407 B
HTML
Raw Normal View History

2022-03-27 20:38:29 +08:00
<p>设计一个算法找出数组中最小的k个数。以任意顺序返回这k个数均可。</p>
<p><strong>示例:</strong></p>
<pre><strong>输入:</strong> arr = [1,3,5,7,2,4,6,8], k = 4
<strong>输出:</strong> [1,2,3,4]
</pre>
<p><strong>提示:</strong></p>
<ul>
<li><code>0 &lt;= len(arr) &lt;= 100000</code></li>
<li><code>0 &lt;= k &lt;= min(100000, len(arr))</code></li>
</ul>