Given a field containing 0, 1, 2… , the sequence of n numbers in n, find 0… The number in n that does not appear in the sequence.

class Solution(object):
    def missingNumber(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        for i in range(len(nums)+1):
            if i not in nums:
                return i
Copy the code