Please enter your email address or userHandle.
Given two numbers M and N. The task is to find the position of rightmost different bit in binary representation of numbers.
The input line contains T, denoting the number of testcases. Each testcase follows. First line of each testcase contains two space separated integers M and N.
For each testcase in new line, print the position of rightmost different bit in binary representation of numbers. If both M and N are same then print -1 in this case.
1 <= T <= 100
1 <= M <= 103
1 <= N <= 103
Tescase 1: Binary representaion of the given numbers are: 1011 and 1001, 2nd bit from right is different.
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Login to access your submissions.
Please choose 'ReadOnlyMode' if you needn't to 'Edit' the problem e.g. viewing OJ's solution, TestCase Files (TCFs), TimeLimit etc.