Search in Rotated Sorted Array II – Python 3 ( Week 11 – 05)

class Solution:
def search(self, nums: List[int], target: int) -> bool:
for num in nums:
if num == target:
return True
return False

Time O(n). Space O(1).

Leave a comment

Design a site like this with WordPress.com
Get started