best JAVA solution
\nTC : Calculating the frequency Count for a no would be O(no of digits in N). Also,there could a case where it matches with 2^31 (last power of 2).So the compl
\n**TC : Calculating the frequency Count for a no would be O(no of digits in N). Also,there could a case where it matches with 2^31 (last power of 2).So the complexity would be O(32*length(2^32) + O(no of digits in N)**\n```\nclass Solution { \n    \n    public boolean reorderedPowerOf2(int n) \n    {\n\t\tint [] nFreq=digitFreq(n);\n        \n        for(int i=0;i<31;i++) //Within the integer range max power of 2 that lies is 2^31\n        {\n            int powerOf2=(int)Math.pow(2,i);\n            int [] powerOf2FreqCount = digitFreq(powerOf2);            \n            if(compareFreq(nFreq,powerOf2FreqCount)) \n                return true;            \n        }\n        return false;\n    }\n    \n    private boolean compareFreq (int []nFreq ,int []powerOf2FreqCount){\n        boolean match=true;\n        \n        for(int i=0;i<10;i++){\n            if(nFreq[i]!=powerOf2FreqCount[i])\n                return false;            \n        }\n        return true;\n    }\n    \n    private int [] digitFreq(int num){\n        int [] digitFreq=new int [10];\n        while(num>0){\n            digitFreq[num%10]++;    //counting freq for each digit so here we extracted the last digit from number ( from right side )\n            num /= 10; \n        }\n        return digitFreq;\n    }\n}\n```
['Array']