BinarySearch--SearchinRotatedSortedArray--logic