###########################################################################
#                                                                         #
# Author: Daniel Mock                                                     #
#                                                                         #
# Purpose: To document progress in learning algorithms & data structures  #
#                                                                         #
# References: This question was generated by leetcode.com. The solution   #
# to the question was generated by Daniel Mock.                           #
#                                                                         #
###########################################################################

class Solution:
    def missingNumber(self, nums: List[int]) -> int:
        lst = sorted(nums)
        if lst[0] > 0:
            return 0
        prev = lst.pop(0)
        for i in lst:
            if prev + 1 != i:
                return (prev+1)
            prev = i
        return prev+1
