Binary search in rotated array iterative solution