Tap here to switch tabs
Problem
Submissions

Problem: Smallest Number With All Set Bits

Smallest Number With All Set Bits asks you to return the smallest number at least as large as a given positive integer whose binary representation contains only ones.

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

Smallest Number With All Set Bits asks you to return the smallest number at least as large as a given positive integer whose binary representation contains only ones.

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