Class Solution
-
- All Implemented Interfaces:
public final class Solution869 - Reordered Power of 2\.
Medium
You are given an integer
n. We reorder the digits in any order (including the original order) such that the leading digit is not zero.Return
trueif and only if we can do this so that the resulting number is a power of two.Example 1:
Input: n = 1
Output: true
Example 2:
Input: n = 10
Output: false
Constraints:
<code>1 <= n <= 10<sup>9</sup></code>
-
-
Constructor Summary
Constructors Constructor Description Solution()
-
Method Summary
Modifier and Type Method Description final BooleanreorderedPowerOf2(Integer n)-
-
Method Detail
-
reorderedPowerOf2
final Boolean reorderedPowerOf2(Integer n)
-
-
-
-