Reverse Bits

Reverse the bits of a given 32-bit unsigned integer.

Constraints

  • The input must be a binary string of length 32
Saving… · 2 lines
class Solution:
def reverseBits(self, n: int) -> int:
Console

Click Run to execute sample tests.