Same as I, just ignore the equal items in the tail of nums with num[0].

Average time complexity is O(logn) while the worst is O(n).

```
class Solution(object):
def search(self, nums, target):
low, high = 0, len(nums) - 1
while low < high and nums[low] == nums[high]:
high -= 1
while low <= high:
mid = low + high >> 1
if nums[mid] == target:
return True
if (target >= nums[0] and nums[0] <= nums[mid] < target or
target < nums[0] and not target < nums[mid] < nums[0]):
low = mid + 1
else:
high = mid - 1
return False
```