Tap here to switch tabs
Problem
Submissions

Problem: Exactly One Consecutive Set Bits Pair

Exactly One Consecutive Set Bits Pair asks whether an integer's binary representation contains exactly one pair of adjacent ones, returning true only when that condition is met.

Statement

Given an integer n, return true if the binary representation of n contains exactly 11 adjacent pair of set bits (11s), and false otherwise.

Constraints:

  • 0≤0 \leq n ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Exactly One Consecutive Set Bits Pair

Exactly One Consecutive Set Bits Pair asks whether an integer's binary representation contains exactly one pair of adjacent ones, returning true only when that condition is met.

Statement

Given an integer n, return true if the binary representation of n contains exactly 11 adjacent pair of set bits (11s), and false otherwise.

Constraints:

  • 0≤0 \leq n ≤105\leq 10^5