search in rotated sorted array with duplicates