solve search in rotated sorted array