@@ -14,7 +14,7 @@ func (is ints) swap(i, j int) { is[i], is[j] = is[j], is[i] }
func (is ints) getN(n int) int { // Get the Nth smallest number.
l := len(is)
lo, hi := 0, l-1
- for lo < hi {
+ for lo <= hi {
m := is.partition(lo, hi)
if m == n-1 {
return is[m]