3370. Smallest Number With All Set Bits
You are given a positive number
n
.Return the smallest number
x
greater than or equal ton
, such that the binary representation ofx
contains only set bits.A set bit refers to a bit in the binary representation of a number that has a value of
1
.
1 | class Solution { |