Go | Golang Solution
\nfunc reorderedPowerOf2(n int) bool {\n\tstr := strconv.Itoa(n)\n\tstrByte := []byte(str)\n\tsort.Slice(strByte, func(i, j int) bool { return strByte[i] < strB
```\nfunc reorderedPowerOf2(n int) bool {\n\tstr := strconv.Itoa(n)\n\tstrByte := []byte(str)\n\tsort.Slice(strByte, func(i, j int) bool { return strByte[i] < strByte[j] })\n\tfor i := 0; i < 31; i++ {\n\t\ttmp := strconv.Itoa(1 << i)\n\t\ttmpByte := []byte(tmp)\n\t\tsort.Slice(tmpByte, func(i, j int) bool { return tmpByte[i] < tmpByte[j] })\n\t\tif string(strByte) == string(tmpByte) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n```\n\nuse slice as counter (can\'t use == to compare two slice)\n```\nfunc reorderedPowerOf2(n int) bool {\n\tcount := func(n int) []int {\n\t\tresult := make([]int, 10)\n\t\tfor n > 0 {\n\t\t\tresult[n%10]++\n\t\t\tn /= 10\n\t\t}\n\t\treturn result\n\t}\n\tcompare := func(s1, s2 []int) bool {\n\t\tfor i := 0; i < 10; i++ {\n\t\t\tif s1[i] != s2[i] {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\tnCnt := count(n)\n\tfor i := 0; i < 31; i++ {\n\t\tif compare(nCnt, count(1<<i)) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n```\n\nuse array as counter (can use == to compare two array)\n```\nfunc reorderedPowerOf2(n int) bool {\n\tcount := func(n int) [10]int {\n\t\tvar result [10]int\n\t\tfor n > 0 {\n\t\t\tresult[n%10]++\n\t\t\tn /= 10\n\t\t}\n\t\treturn result\n\t}\n\tnCnt := count(n)\n\tfor i := 0; i < 31; i++ {\n\t\tif nCnt == count(1<<i) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n```
['Go']