100% Faster Solution
\n\nclass Solution {\npublic:\n\n    bool equal(vector<int>&a,vector<int>&b ){\n        for(int i=0;i<10;i++){\n            if(a[i]!=b[i])return false;\n       
\n```\nclass Solution {\npublic:\n\n    bool equal(vector<int>&a,vector<int>&b ){\n        for(int i=0;i<10;i++){\n            if(a[i]!=b[i])return false;\n        }\n        return true;\n    }\n    vector<int> freq(int n){\n        vector<int>f(10,0);\n        while(n>0){\n            f[n%10]++;\n            n/=10;\n        }\n        return f;\n    }\n    \n    bool reorderedPowerOf2(int n) {\n        vector<int>a(10,0);\n        vector<int>b(10,0);\n        a=freq(n);\n        for(int i=0;i<31;i++){\n            b=freq(pow(2,i));\n            if(equal(a,b))return true;\n        }\n        return false;\n    }\n};\n```\n\n\n
[]