Implement the search in a rotated sorted array.