```
class Solution(object):
def missingNumber(self, nums):
return (len(nums) + 1) * len(nums) / 2 - sum(nums)
```

The idea is that given N, the total sum of 0,1,2,...N is always (N+1) * N / 2

So the difference between sum(nums) and the total sum would be the missing number!