Possibly fastest C++ solution using Multiset, 0ms runtime.
So, the idea is very simple:\n1. Convert N into a multiset of its digits, for an example, if N = 426412 then the multiset will contain {1, 2, 2, 4, 4, 6}.\n2. N
**So, the idea is very simple:**\n1. Convert `N` into a multiset of its digits, for an example, if `N = 426412` then the multiset will contain `{1, 2, 2, 4, 4, 6}`.\n2. Now, we will generate some 2\'s power and will convert them into another multiset as well, **if both multiset are same**, function will return **true**\n3. To speed up the process we don\'t need to find all `2`\'s power. In fact, it will depent on `N`, if `N` has `6` digits, I compute `2^12 to 2^20`, the above number is `2^18`, when both set matches, we just return true.\n\n```\nprivate:    \n    multiset<int> convert(int num) {        //  this function converts a number into a multiset of its digit.\n        multiset<int> allDigit;\n        while(num) { allDigit.insert(num%10); num /= 10; }\n        return allDigit;\n    }\n    \npublic:\n    bool reorderedPowerOf2(int N) {\n    \n        if(N<10) {                                          //  for single digit\n            if (N==1 || N==2 || N==4 || N==8) return true;\n            return false;\n        }\n\n        multiset<int> digitN;\n        int num = N, cc=0, powerOf2=8;\n\n        while(num) { digitN.insert(num%10); num /= 10; cc++;}\n\n        for(int i=4; i <= 4*cc; i++) {      //  number of digit in decimal <= 4 * number of digit in binary\n            powerOf2 *= 2;\n            multiset<int> digitNum = convert(powerOf2);\n            if(digitNum == digitN) return true;\n        }\n        return false;\n    }\n```
[]