On 02/25/2018 10:18 PM, Joel wrote: > if (arr[i] > n) > arr = arr[i + 1 .. $]; When `arr[i]` is greater than `n`, then the values in `arr[i + 1 .. $]` will only be even greater. You're picking the wrong half of the array.