Simple Cpp Solution
```\nclass Solution {\npublic:\n    vector func(int n){\n        vectorans(10);\n        \n        while(n){\n            ans[n%10]++;\n            n/=10;\n    
```\nclass Solution {\npublic:\n    vector<int> func(int n){\n        vector<int>ans(10);\n        \n        while(n){\n            ans[n%10]++;\n            n/=10;\n        }\n        \n        return ans;\n    }   \n    \n    bool reorderedPowerOf2(int n) {\n                \n        if((n&(n-1))==0)return true;\n        \n        vector<int>ans=func(n);\n        \n        for(int i=1;i<31;i++){\n            vector<int>v=func(1<<i);\n            if(v==ans)return true;\n        }\n        \n        return false;\n    }\n};
['C++']