def missingNumber(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
n = len(nums)
return (n*(n+1)/2)  sum(nums)
Simple Python Solution (2 lines)

@grodrigues3 >! How does this work for [4,5,6,8] . Wont the answer turn out to be negative?

@tusharkailash29 I think in the question it says the sequence starts with a 0. If 0 is missing then, the array must definitely start with a 1. What you raised is valid for a more general form of the question to find a missing element from a sequence of contiguous numbers.