869. Reordered Power of 2
Description
Starting with a positive integer N, we reorder the digits in any order (including the original order) such that the leading digit is not zero.
Return true if and only if we can do this in a way such that the resulting number is a power of 2.
Constraints
1 <= N <= 10^9
Approach
Links
GeeksforGeeks
ProgramCreek
Examples
Input: 1
Output: true
Input: 10
Output: false
Input: 16
Output: true
Input: 24
Output: false
Input: 46
Output: true
Solutions
Follow up
Last updated
Was this helpful?