Search for element in a rotated sorted array