Tap here to switch tabs
Problem
Submissions

Problem: Smallest Number With All Set Bits

med
30 min
Try to solve the Smallest Number With All Set Bits problem.

Statement

Given a positive integer n, return the smallest number x such that x ≥\geq n, and the binary representation of x consists exclusively of set bits (11s).

Constraints:

  • 1≤1 \leq n ≤1000\leq 1000

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Smallest Number With All Set Bits

med
30 min
Try to solve the Smallest Number With All Set Bits problem.

Statement

Given a positive integer n, return the smallest number x such that x ≥\geq n, and the binary representation of x consists exclusively of set bits (11s).

Constraints:

  • 1≤1 \leq n ≤1000\leq 1000