Problem Description
Given an 1D integer array A containing N distinct integers.
Find the number of unique pairs of integers in the array whose XOR is equal to B.
NOTE:
1 <= N <= 105
1 <= A[i], B <= 107
First argument is an 1D integer array A.
Second argument is an integer B.
Return a single integer denoting the number of unique pairs of integers in the array A whose XOR is equal to B.
Input 1:
A = [5, 4, 10, 15, 7, 6] B = 5
Input 2:
A = [3, 6, 8, 10, 15, 50] B = 5
Output 1:
1
Output 2:
2
Explanation 1:
(10 ^ 15) = 5
Explanation 2:
(3 ^ 6) = 5 and (10 ^ 15) = 5
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 question? Checkout Sample Codes for more details.