You are given an integer array A of size N. Your task is to count and print the number of XOR-AND inversions in array A. A pair (‘i’, ‘j’) is said to be an XOR-AND inversion if and only if it satisfies the following conditions:

Q1) Given : A[i]&A[j]>=A[i]^A[j] and let's check for the most significant bit of A[i] and A[j] let it be at xth and yth position from right respectively. If x is not equal to y then XOR will be always greater than AND . If x is equal to y then AND will be greater because XOR's corresponding bit would be unset, which means same number of set bits. Hence we need to just count pairs with same count of bits.