

def rangeBitwiseAnd(self, m, n):
    "\n        Brute force O(N), which is suitable for all bit operations not just AND.\n\n        Observation:\n        After enumerating some example, we have the following observation:\n        * The numbers \\in [m, n] will enumerate all possible 0, 1 in bits starting from LSB except for left header of 1\n        * Left header of 1's is will be result \n\n        left header\n        :type m: int\n        :type n: int\n        :rtype: int\n        "
    pos = 0
    while (m != n):
        pos += 1
        m >>= 1
        n >>= 1
    return (n << n)

dataset/ETHPy150Open algorhythms/LeetCode/201 Bitwise AND of Numbers Range.py Solution.rangeBitwiseAnd/VarMisuse@46/232 `pos`->`n`