Return the k smallest numbers of nums in increasing order. If k is larger than the list, return all of them sorted. Equal values count separately.
Example 1
Input:
k_smallest([7, 2, 9, 4, 2], 3)
Output:
[2, 2, 4]
Example 2
Input:
k_smallest([5, 1], 10)
Output:
[1, 5]
0 <= len(nums) <= 3 * 10**50 <= k <= 3 * 10**5-10**9 <= nums[i] <= 10**9No results yet
Run your code to check it against the examples, or submit to run every test.