Tap here to switch tabs
Problem
Submissions

Problem: Count Monobit Integers

med
30 min
Try to solve the Count Monobit Integers problem.

Statement

Given an integer n, return the number of integers in the range [0,‘n‘][0, `n`] that are monobit integers.

An integer is defined as a monobit integer if all the bits in its standard binary representation without leading zeros are identical.

Constraints:

  • 0≤‘n‘≤10000 \leq `n` \leq 1000

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Monobit Integers

med
30 min
Try to solve the Count Monobit Integers problem.

Statement

Given an integer n, return the number of integers in the range [0,‘n‘][0, `n`] that are monobit integers.

An integer is defined as a monobit integer if all the bits in its standard binary representation without leading zeros are identical.

Constraints:

  • 0≤‘n‘≤10000 \leq `n` \leq 1000