Design an algorithm to find the smallest K numbers in an array.
Example:
Input: arr = [1,3,5,7,2,4,6,8], k = 4 Output: [1,2,3,4]
Note:
0 <= len(arr) <= 100000
0 <= k <= min(100000, len(arr))
Design an algorithm to find the smallest K numbers in an array.
Example:
Input: arr = [1,3,5,7,2,4,6,8], k = 4 Output: [1,2,3,4]
Note:
0 <= len(arr) <= 100000
0 <= k <= min(100000, len(arr))