The Codility demo test solved. The routine starts looking for the solution in the middle of the array and moving left and right each iteration.