number. You may rearrange its digits in any order (including leaving them as they are), as long as the first digit is not zero.
Return True if some such rearrangement is a power of two (1, 2, 4, 8, 16, …), and False otherwise.number=821 → True
The digits 8, 2, 1 can form 128 = 2⁷.
number=23 → True
Only 23 and 32 are possible, and 32 = 2⁵ works.
number=40 → False
Zero cannot go first, so only 40 remains, and it is not a power of two.
number=821
True
Run checks the first 3 tests in your browser. Submit checks all 82 tests on the server, hidden ones included.