81_Search in Rotated Sorted Array II
81. Search in Rotated Sorted Array II
Question
follow up of Q33 Search in Rotated Sorted Array
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.Example 1
Input: nums = [1, 2, 1, 1, 1]
target = 2
Output: TureIdea (binary search)
Complexity
Solution
Last updated