AlgoMaster Logo

Missing Number

nums=[3, 0, 1]
0 / 5
012301XOR all indices (1..n) and elements to find missing number
algomaster.io
Step:Find the missing number using XOR. XOR of a number with itself is 0, and XOR with 0 is the number itself.