Easy to follow python solution


  • 3
    G

    def missingNumber(self, nums):

        a=[]
        for k in range(0,len(nums)+1):
            a.append(k)
        return sum(a)-sum(nums)

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.