

f(2, 3) = 1, as 2 → 0010 and 3 → 0011, only the last bit is different in both the numbers, hence f(2, 3) is 1.
As the final answer may be very large, return your answer modulo 10^9 + 7.
The first line of the input contains a single integer T, representing the number of test cases.
The first line of each test case consists of a single integer 'N', representing the number of elements in the given array.
The second line of each test case contains 'N' space-separated integers, denoting the elements of the array.
For each test case, print the sum of bit differences among all possible pairs in the given array.
Print the output of each test case in a separate line.
You do not need to print anything. It has already been taken care of. Just implement the given function.
1 <= T <= 100
1 <= N <= 10^4
0 <= arr[i] < 10^9
Time Limit: 1sec
An easy way to solve this problem will be to run a double loop to consider every possible pair in the given array and add its count of different bits to the final result variable.
Algorithm