Search inside a rotated array