You are given an Array, A of size N and an integer K.
You are required to find the total number of pairs of A[i] and A[j] where i!=j such that A[i] xor A[j] = x for x ranging from 0 to K.
Input Format :
First line - N K
Second line - N integers representing the array, A.
Output Format :
Your function should return a vector of size K where each index, i , represents the number of pair whose XOR is i.
Test Case:
3 3
1 2 3
Output - 0 1 1
Explanation - Considering all the pairs : 1^2 = 3 , 1^3 = 2 , 2^3 = 1
Pairs with xor x :
For x = 0 - Pairs = 0
For x = 1 - Pairs = 1
Fot x = 2 - Pairs = 1
Hence, 0 1 1
Constraints :
0 <= N,K <= 10^5
0 <= A[i] <= 10^8