


1. Do not print anything, just implement the provided function and return the number of mismatching bits for the given numbers.
The first line of input contains an integer ‘T’ denoting the number of test cases.
The next ‘T’ lines represent the ‘T’ test cases.
The only line of each test case contains 2 space-separated integers "first" and "second"
For each test case, print a single integer denoting the number of mismatched bits in their binary representation.
The output of each test case will be printed in a separate line.
1 <= T <= 10 ^ 5
0 <= first, second <= 10^9
Where ‘T’ is the total number of test cases and "first", " second" are the given numbers.
Time limit: 1 second
The key idea is to check for each bit if it is different or not.
Consider the following steps:
Since we need to find the number of mismatching bits, we can use the XOR operator as the XOR of two given numbers will give the result 1 in the bits where the bits of the given numbers differ as shown in the truth table above.
Once the result is calculated, we just need to count the number of set bits in the answer.
To calculate the number of set bits we can either use a library function (for eg __builtin_popcount in C++) or calculate it using a loop.
Consider the following steps: