Binary search the starting index of the best k-length window instead of comparing each element independently.