This is a classical interview question in which you are asked to find the location of the rightmost and the leftmost 1's in the binary representation of a number. I. Rightmost Set Bit & Rightmost Bit Here we compute the AND between the original number (say N) with its two's complement (its negative form). Thus,… Continue reading BLOG | Find the rightmost & leftmost set bit of an integer

