Track with Hashmap | Easy & Simple Solution
\nclass Solution {\npublic:\n    bool reorderedPowerOf2(int n) {\n        vector<int> powers;\n        for(int i=1;i<=1e9;i*=2){\n            powers.push_back(i
```\nclass Solution {\npublic:\n    bool reorderedPowerOf2(int n) {\n        vector<int> powers;\n        for(int i=1;i<=1e9;i*=2){\n            powers.push_back(i);\n        }\n        \n        map<int,int> demand;\n        while(n>0){\n            demand[n%10]++;\n            n/=10;\n        }\n        \n        for(auto& num:powers){\n            map<int,int> curr;\n            while(num>0){\n                curr[num%10]++;\n                num/=10;\n            }\n            \n            if(curr==demand){\n                return true;\n            }\n        }\n        \n        return false;\n    }\n};\n```
[]