Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.
(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).
Write a function to determine if a given target is in the array.
The array may contain duplicates.
解法1: O(logN), worst case O(n)
当有重复值的时候,我们在判断丢弃left或者是right half的时候,如果碰到nums[mid] == nums[end]或者nums[mid] == nums[start]的时候,不能判断哪一个部分需要抛弃。这个时候只能让end–或者start–
C++
Java