Min XOR value


Problem Setter: mihai.gheorghe Problem Tester: archit.rai

Given an array of N integers, find the pair of integers in the array which have minimum XOR value. Report the minimum XOR value.

Examples :
Input
0 2 5 7
Output
2 (0 XOR 2)
Input
0 4 7 9
Output
3 (4 XOR 7)

Constraints:
2 <= N <= 100 000
0 <= A[i] <= 1 000 000 000

NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.
Start solving Min XOR value on Interview Code Editor
Sign Up
to access hints and editorial solutions for Min XOR value
Asked In:

Discussion


Loading...
Click here to start solving coding interview questions