Dsa
Bit Manipulation
Medium
Bitwise AND for Range
Given two integers, a and b, calculate the bitwise AND of all the numbers in the inclusive range [a, b].
For example:
Input:
5 7
Output:
4
Explanation:
The numbers in range are 5, 6, and 7. The bitwise AND of 5 & 6 & 7 is 4.
Key concepts
bit manipulationrange operations
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now