Comment Comment by areyousure After the first iteration of the loop (and every other one too), A[i] is the maximum of the array, not the minimum. parent areyousure 5 years ago