# 869. 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 `true` *if and only if we can do this so that the resulting number is a power of two*.

&#x20;

**Example 1:**

<pre><code>Input: n = 1
<strong>Output:
</strong> true
</code></pre>

**Example 2:**

<pre><code>Input: n = 10
<strong>Output:
</strong> false
</code></pre>

&#x20;

**Constraints:**

* `1 <= n <= 10^9`

```python
class Solution:
    def reorderedPowerOf2(self, n: int) -> bool:
        #.
        count = collections.Counter(str(n))
        return any(count == collections.Counter(str(1 << i)) for i in range(30))
```
