Find the Missing Number

00:00
EasyArrayMathBit ManipulationXOR
TCSInfosysWipro

Given array of n distinct numbers from [0,n], find the one missing number. E.g. n=3, numbers should be [0,1,2,3] and one is absent.

Examples

Input → [3,0,1]
Output → 2
Input → [0,1]
Output → 2
Input → [9,6,4,2,3,5,7,0,1]
Output → 8
Input → [0]
Output → 1