Java | Sort
We can do the hash thing or we can also just sort it.\nI think sorting is easier. \nJava\nclass Solution {\n    public boolean reorderedPowerOf2(int n) {\n     
We can do the hash thing or we can also just sort it.\nI think sorting is easier. \n```Java\nclass Solution {\n    public boolean reorderedPowerOf2(int n) {\n        for (int i = 0; i <= 30; i++){\n            char[] a = (""+(1<<i)).toCharArray();\n            char[] b = (""+n).toCharArray();\n            Arrays.sort(a);\n            Arrays.sort(b);\n            if (Arrays.equals(a, b)){\n                return true;\n            }\n        }\n        return false;\n    }\n}\n```
['Sorting', 'Java']