Bit ManipulationMathArray
An array holds n distinct numbers taken from the range 0 to n. Exactly one number from that range is missing. Find it.
Input
Line 1: n. Line 2: n distinct integers, each between 0 and n.
Output
Print the missing number.
Constraints
1 <= n <= 10^5
Example 1
Input
3 3 0 1
Output
2
The range is 0..3 and 2 is absent.