make it nlogn
seatch in rotated sorted array with dup