C++ Clear Solution with Explanation - Runtime: 0 ms, faster than 100.00%
1.Brute force Approach: Find all possible combinations of numbers that can be formed from the Given Target number\'s digits  and for each combination check if i
1.**Brute force Approach:** Find all possible combinations of numbers that can be formed from the Given Target number\'s digits  and for each combination check if it is a\n power of 2 or not . (Hint :   Convert the number to string )\n 2. **Optimised/Efficient Approach:** We can see the constraint for n is *1 <= n <= 10^9* \n*   If somehow we can show that , with the given number\'s digits we can form a number which is a power of 2 , then our job is done!\n*   First of all , We will keep the count of the frequency of digits  of the given number and then we will check if the frequency count matches or not for every power of 2 within the given constraint.\n*   Linear Time Complexity Solution \n```\nclass Solution {\npublic:\n    vector<int>nfreq;\n    vector<int> util(int n)  // To find the freqeuncy of digits of a number\n    {\n        vector<int>digitFreq(10,0); \n        \n        while(n>0)\n        {\n            int rem = n%10;\n            n = n/10;\n            digitFreq[rem]++;\n        }\n        return digitFreq;\n    }\n    bool reorderedPowerOf2(int n) {\n     \n        nfreq = util(n);\n        for(int i= 0;i<32;++i)\n        {\n            if(nfreq == util(1<<i))   // Checking condition \n                return true;\n        }\n        \n        return false;\n    }\n};\n```
['Math', 'C', 'Counting']