Solution 1

Python · 2026-02-16
class Solution:
    def reverseBits(self, n: int) -> int:
        out = str(bin(n)[2:])
        out = "0"*(32-len(out)) + out
        out = out[::-1]
        return int(out, 2)
Leet Code/python.py · L5333–5339