Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

spencerxhani

🎯
Focusing
  • Taipei, Taiwan
View GitHub Profile
View 33. Search in Rotated Sorted Array.py
class Solution:
def search(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
start, end = 0, len(nums) - 1
while start <= end:
mid = start + (end - start) // 2 # mid is a pivot index
You can’t perform that action at this time.