One approach to solve this problem is to use the Gauss formula, which states that the sum of the numbers from 1 to n is n*(n+1)/2. We can use this formula to find the sum of all numbers in the range [0, n]. Then, we can loop through the given array and subtract each number from the sum. The result will be the missing number. Here's the code:

```
def missingNumber(nums):
    n = len(nums)
    total_sum = n*(n+1)//2    # // is integer division
    for num in nums:
        total_sum -= num
    return total_sum
```

Note that we use integer division (//) in the second line to make sure the result is an integer.
Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array.