Tap here to switch tabs
Problem
Submissions

Problem: Bitwise AND of Numbers Range

Bitwise AND of Numbers Range asks you to compute the bitwise AND of every integer in an inclusive range given its smallest and largest values, which are nonnegative.

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

Bitwise AND of Numbers Range asks you to compute the bitwise AND of every integer in an inclusive range given its smallest and largest values, which are nonnegative.

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