A utility function to find the nth minimum

.NthMin(x, index)

Arguments

x

the given unsorted vector

index

N.

Value

the nth minimum element of the vector