:type nums: List[int] :type target: int :rtype: int
(self, nums, target)
| 80 | |
| 81 | |
| 82 | def search(self, nums, target): |
| 83 | """ |
| 84 | :type nums: List[int] |
| 85 | :type target: int |
| 86 | :rtype: int |
| 87 | """ |
| 88 | if not nums: |
| 89 | return False |
| 90 | |
| 91 | rotate_index = self.find_rotate(nums) |
| 92 | |
| 93 | lo = 0 |
| 94 | hi = rotate_index |
| 95 | |
| 96 | one = self.bi_search(nums, target, lo, hi) |
| 97 | if one != -1: |
| 98 | return True |
| 99 | |
| 100 | two = self.bi_search(nums, target, hi, len(nums)) |
| 101 | if two != -1: |
| 102 | return True |
| 103 | return False |
nothing calls this directly
no test coverage detected