A Java solution which easy understand 
\nclass Solution {\n    public boolean reorderedPowerOf2(int N) {\n        for(int ans=1;ans<=Math.pow(10,9);ans*=2)\n            if(equal(N,ans))\n            
```\nclass Solution {\n    public boolean reorderedPowerOf2(int N) {\n        for(int ans=1;ans<=Math.pow(10,9);ans*=2)\n            if(equal(N,ans))\n                return true;\n        return false;\n    }\n    public boolean equal(int num1,int num2){\n        char[] str1 = Integer.toString(num1).toCharArray(),str2 = Integer.toString(num2).toCharArray();\n        int[] nums = new int[10];\n        for(int i=0;i<str1.length;i++) nums[str1[i] - \'0\']--;\n        for(int i=0;i<str2.length;i++) nums[str2[i] - \'0\']++;\n        for(int i:nums)\n            if(i!=0) return false;\n        return true;\n    }\n}\n```
[]