search in rotated sorted array which have duplicates