给自己看
class Solution: def search(self , nums: List[int], target: int) -> int: if target in nums: left = 0 right = len(nums)-1 while left!=right: if nums[int((left+right)/2)]>target: right = int((left+right)/2)-1 elif nums[int((left+right)/2)]==target: left = int((left+right)/2) break else: left = int((left+right)/2)+1 return left else: return -1