num. Return the smallest number that is at least num and whose binary form is made up of ones only.num=9 → 15
9 is 1001 in binary. The nearest all-ones number is 1111, which is 15.
num=31 → 31
31 is 11111 in binary, already all ones.
num=2 → 3
num=9
15
Run checks the first 3 tests in your browser. Submit checks all 55 tests on the server, hidden ones included.