As reported: NetApp SDE-1 (Bangalore, 2026), round 2 — DSA and OS, in person: Bitwise AND of Numbers Range as the medium DSA question.
Given two integers left and right with left ≤ right, return the bitwise AND of all numbers in the range [left, right], inclusive.
This is LeetCode 201 — Bitwise AND of Numbers Range.
Example 1
left = 5, right = 7 -> 4 101 & 110 & 111 = 100
Example 2
left = 0, right = 0 -> 0
Example 3
left = 1, right = 2147483647 -> 0
Constraints: 0 ≤ left ≤ right ≤ 2^31 − 1.
Code runner format: two lines: left, then right. Implement rangeBitwiseAnd(left, right); the harness prints the returned number.