1 class Solution(object): 2 def missingNumber(self, nums): 3 """ 4 :type nums: List[int] 5 :rtype: int 6 """ 7 for i in range(len(nums) + 1): 8 if i not in nums: 9 return i 10 11 12 if __name__ == '__main__': 13 solution = Solution() 14 print(solution.missingNumber([9, 6, 4, 2, 3, 5, 7, 0, 1])) 15 print(solution.missingNumber([0]))