def rangeBitwiseAnd(self, m, n):
        pos = 0
        while m != n:
            pos += 1
            m >>= 1
            n >>= 1

        return n << pos  # or m << pos
Brute force O(N), which is suitable for all bit operations not just AND.
dataset/ETHPy150Open algorhythms/LeetCode/201 Bitwise AND of Numbers Range.py/Solution.rangeBitwiseAnd