Class Solution

java.lang.Object
g0801_0900.s0869_reordered_power_of_2.Solution

public class Solution extends Object
869 - Reordered Power of 2.<p>Medium</p> <p>You are given an integer <code>n</code>. We reorder the digits in any order (including the original order) such that the leading digit is not zero.</p> <p>Return <code>true</code> <em>if and only if we can do this so that the resulting number is a power of two</em>.</p> <p><strong>Example 1:</strong></p> <p><strong>Input:</strong> n = 1</p> <p><strong>Output:</strong> true</p> <p><strong>Example 2:</strong></p> <p><strong>Input:</strong> n = 10</p> <p><strong>Output:</strong> false</p> <p><strong>Constraints:</strong></p> <ul> <li><code>1 <= n <= 10<sup>9</sup></code></li> </ul>
  • Constructor Details

    • Solution

      public Solution()
  • Method Details

    • reorderedPowerOf2

      public boolean reorderedPowerOf2(int n)