[C++/Java/Python] Straight Forward
counter will counter the number of digits 9876543210 in the given number.\nThen I just compare counter(N) with all counter(power of 2).\n1 <= N <= 10^9, so up t
`counter` will counter the number of digits 9876543210 in the given number.\nThen I just compare `counter(N)` with all `counter(power of 2)`.\n`1 <= N <= 10^9`, so up to 8 same digits.\nIf `N > 10^9`, we can use a hash map.\n\n**C++:**\n```\n    bool reorderedPowerOf2(int N) {\n        long c = counter(N);\n        for (int i = 0; i < 32; i++)\n            if (counter(1 << i) == c) return true;\n        return false;\n    }\n\n    long counter(int N) {\n        long res = 0;\n        for (; N; N /= 10) res += pow(10, N % 10);\n        return res;\n    }\n```\n\n**Java:**\n```\n    public boolean reorderedPowerOf2(int N) {\n        long c = counter(N);\n        for (int i = 0; i < 32; i++)\n            if (counter(1 << i) == c) return true;\n        return false;\n    }\n    public long counter(int N) {\n        long res = 0;\n        for (; N > 0; N /= 10) res += (int)Math.pow(10, N % 10);\n        return res;\n    }\n```\n**Python:**\n```\n    def reorderedPowerOf2(self, N):\n        c = collections.Counter(str(N))\n        return any(c == collections.Counter(str(1 << i)) for i in xrange(30))\n```\n\n\n**Python 1-line**\nsuggested by @urashima9616, bests 80%\n```\n    def reorderedPowerOf2(self, N):\n        return sorted(str(N)) in [sorted(str(1 << i)) for i in range(30)]\n```
[]