A utility function to find the nth minimum
.NthMin(x, index)
x
the given unsorted vector
index
N.
the nth minimum element of the vector