Tap here to switch tabs
Problem
Submissions

Problem: Bitwise AND of Numbers Range

med
30 min
Try to solve the Bitwise AND of Numbers Range problem.

Statement

Given two integers left and right representing a range of numbers, return the bitwise AND of all integers in the inclusive range from left to right.

Note: The bitwise AND of a range is the result of applying the bitwise AND operation to every number in the range.

Constraints:

  • 0≤0 \leq left ≤\leq right ≤231−1\leq 2^{31} - 1

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Bitwise AND of Numbers Range

med
30 min
Try to solve the Bitwise AND of Numbers Range problem.

Statement

Given two integers left and right representing a range of numbers, return the bitwise AND of all integers in the inclusive range from left to right.

Note: The bitwise AND of a range is the result of applying the bitwise AND operation to every number in the range.

Constraints:

  • 0≤0 \leq left ≤\leq right ≤231−1\leq 2^{31} - 1