<jupyter_start><jupyter_text>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. Example 1:    Input: 1    Output: trueExample 2:    Input: 10    Output: falseExample 3:    Input: 16    Output: trueExample 4:    Input: 24    Output: falseExample 5:    Input: 46    Output: true Note:    1 <= N <= 10^9<jupyter_code>class Solution:
    def reorderedPowerOf2(self, N: int) -> bool:
        from collections import Counter
        c = Counter(str(N))
        return any(c == Counter(str(1 << i)) for i in range(30))
    
# test
Solution().reorderedPowerOf2(46)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08634020618556701, 'fraction_numerical': 0.03350515463917526, 'mean_word_length': 3.414772727272727, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '247169', 'license': 'MIT', 'n_tokens_mistral': 255, 'n_tokens_neox': 228, 'n_words': 99, 'path': 'DSA/math/reorderedPowerOf2.ipynb', 'repo_name': 'lance-lh/Data-Structures-and-Algorithms', 'size': '776'}