class Solution {
func reverseBits(_ n: Int) -> Int {
print(String(n, radix: 2))
var ret: Int = 0
var cnt: Int = 0
for bit in String(n, radix:2).reversed() {
if bit == "0" {
ret = ret << 1
} else {
ret = ret << 1 + 1
}
cnt += 1
}
ret = ret << (32 - cnt)
return ret
}
}