You have a list of n integers and you want the x smallest. For example,
x_smallest([1, 2, 5, 4, 3], 3) should return [1, 2, 3].
x_smallest([1, 2, 5, 4, 3], 3)
[1, 2, 3]
I\'ll v
Psudocode:
def x_smallest(array arr, int limit) array ret = new array[limit] ret = {INT_MAX} for i in arr for j in range(0..limit) if (i < ret[j]) ret[j] = i endif endfor endfor return ret enddef