Python3 代码
```
class Solution(object):
def getMissingNumber(self, nums):
“”“
:type nums: List[int]
:rtype: int
“”“
if len(nums) == 0:
return 0
x = -1
for i in range (0, len(nums)):
if nums [i] != i:
x = i
break
if x == -1:
return len(nums)
else:
return x```