Leetcode Daily Question
2.45K subscribers
517 files
2.16K links
Why are you asking me to do Leetcode for this CSS job?
Download Telegram
Leetcode-cn.com 2021-09-03
🟡 面试题 17.14.smallest-k-lcci

🏷️ Tags
#array #divide_and_conquer #quickselect #sorting #heap_priority_queue

Description
设计一个算法,找出数组中最小的k个数。以任意顺序返回这k个数均可。

Example
输入: arr = [1,3,5,7,2,4,6,8], k = 4
输出: [1,2,3,4]