We handle lists that contain integers, all between and (both included), and all different. Therefore, exactly one of these numbers is missing. Which one?
Write a function that receives such a list and returns the missing number.
Precondition: we are ensured that the list received by the function will always fulfill the condition that it contains nonnegative integers less than , all different, where is one more than the length of (hence, is also guaranteed as the smallest list has length zero).
>>> missing([2, 1, 0, 4]) 3 >>> missing([1]) 0 >>> missing([0, 1]) 2 >>> missing([4, 3, 5, 6, 0, 1, 8, 9, 7]) 2 >>> missing([]) 0