Bit Manipulation - Bitwise AND of Numbers Range
Examine the code below. What is the logical error that causes incorrect results for some inputs?
def rangeBitwiseAnd(left: int, right: int) -> int:
while left != right:
left >>= 1
right >>= 1
return left << 1