LeetCode 190 Reverse Bits - Problem Statement

The problem

Reverse the bits of a 32-bit unsigned integer.

With n = 00000010100101000001111010011100 (binary):

  • Reversed: 00111001011110000010100101000000.
  • Input: 4326159643261596. Output: 964176192964176192.

With n = 11111111111111111111111111111101:

  • Reversed: 10111111111111111111111111111111.
  • Input: 42949672934294967293. Output: 32212254713221225471.

Constraints: Input is a 32-bit unsigned integer.