Let's say, I have two numbers $$a = (01110100)_2$$ and $$b = (01101011)_2$$
How to find the position of the least significant bit common to
b while reading left to right in constant time $O(1)$ using bitwise operations?
I was reading articles on the web to find the LSB, and all I get is $(x\&-x)$. However, I am not able to convert this concept in finding the common LSB of two numbers
b instead of just one number
For example, for the above numbers, matching is $(011)_2$ so the LSB common to both is at position 5 or 6 (if we consider 0th bit in position 1).
EDIT: Or atleast a faster method than to literally checking bit by bit.