Skip to content

Instantly share code, notes, and snippets.

View spencerxhani's full-sized avatar
🎯
Focusing

spencerxhani

🎯
Focusing
  • Taipei, Taiwan
View GitHub Profile
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