Description
Given two integers left and right that represent the range [left, right], return the bitwise AND of all numbers in this range, inclusive.
Examples
Input:
left = 5, right = 7Output:
4Explanation:
Binary: 101 & 110 & 111 = 100, which is 4 in decimal.
Input:
left = 0, right = 0Output:
0Explanation:
Single element range.
Input:
left = 1, right = 2147483647Output:
0Explanation:
Large range results in 0.
Constraints
- •
0 ≤ left ≤ right ≤ 2³¹ - 1