Watch 10 video solutions for Reordered Power of 2, a medium level problem involving Hash Table, Math, Sorting. This walkthrough by Algorithms Made Easy has 6,070 views views. Want to try solving it yourself? Practice on FleetCode or read the detailed text solution.
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 true if 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:
1 <= n <= 109