Skip to content
C

Find the Missing Number Using XOR

Easyjavapythonccppjavascript

An array contains N distinct values chosen from 0 to N (so exactly one value in that range is missing). Find the missing value using XOR.

Input Format

The first line contains an integer N (the array length). The second line contains N space-separated distinct integers, each between 0 and N.

Output Format

Print the missing number.

Input (stdin)

Output

Run your code to see output here...