Missing Number
Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array.
Missing Number

Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array.

Example 1:
Input: [3,0,1]
Output: 2
Input
arr =[3,0,1]

Find missing number in range [0, 3] using XOR

XOR Result

0

Phase

XOR indices

Array (n=3)
3
idx:0
0
idx:1
1
idx:2
Expected Range [0, 3]
0
1
2
3
Current
Missing
Present
Variables
No variables to display
DepthFunction Call
Stack empty
0/8