标签:数组 strong ber font height mic loading info turn
排序数组中的搜索问题,首先想到 二分法
class Solution: def missingNumber(self, nums: List[int]) -> int: i, j = 0, len(nums)-1 while i <= j: m = (i+j)//2 if nums[m] == m: # 数组的值等于索引值 i= m+1 else: j = m-1 return i
标签:数组 strong ber font height mic loading info turn
原文地址:https://www.cnblogs.com/GumpYan/p/13149911.html