"""Leetcode 201. Bitwise AND of Numbers Range
Medium

URL: https://leetcode.com/problems/bitwise-and-of-numbers-range/

Given a range [m, n] where 0 <= m <= n <= 2147483647,
return the bitwise AND of all numbers in this range, inclusive.

Example 1:
Input: [5,7]
Output: 4

Example 2:
Input: [0,1]
Output: 0
"""


class Solution(object):
    def rangeBitwiseAnd(self, m, n):
        """
        :type m: int
        :type n: int
        :rtype: int
        """
        pass


def main():
    pass


if __name__ == '__main__':
    main()

@@ -466,35 +466,308 @@
     
-pass%0A%0A%0Adef main():%0A    pass
+if m == 0:%0A            return 0%0A%0A        result = m%0A        for i in range(m + 1, n + 1):%0A            result &= i%0A        return result%0A%0A%0Adef main():%0A    # Output: 4%0A    m, n = 5, 7%0A    print Solution().rangeBitwiseAnd(m, n)%0A%0A    # Output: 0%0A    m, n = 0, 1%0A    print Solution().rangeBitwiseAnd(m, n)
 %0A%0A%0Ai

Complete brute force sol