题目描述
blablabla
样例
class Solution(object):
def getMissingNumber(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if not nums or not len(nums):
return 0
left, right = 0, len(nums) - 1
if right == nums[right]:
return right + 1
while left < right:
mid = left + (right - left) // 2
if nums[mid] == mid:
left = mid + 1
else:
right = mid
return nums[left] - 1
if not nums or not len(nums):
这两个判断条件不是等价的吗?