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
2022-03-29 12:43:11 +08:00

15 lines
407 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>设计一个算法找出数组中最小的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>