Solving Search in Rotated Sorted Array II in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.

Example 1:

Input: nums = [2,5,6,0,0,1,2], target = 0
Output: true

Example 2:

Input: nums = [2,5,6,0,0,1,2], target = 3
Output: false

Follow up:

  • Would this affect the run-time complexity? How and why?

See the full details of the problem Search in Rotated Sorted Array II at LeetCode

Originally posted at: