LC 190 — Problem

Reverse bits of a given 32 bits unsigned integer.

Input: n = 00000010100101000001111010011100
Output: 964176192 (00111001011110000010100101000000)
Input: n = 11111111111111111111111111111101
Output: 3221225471 (10111111111111111111111111111111)

The input must be a binary string of length 32.

Here is an 8-bit number: 10110100. Your job is to reverse its bits — produce the number whose binary representation reads the original backwards. No code, no hints. Just you and eight bit positions.

Try it — toggle the output bits to match the reversed input. Tap each cell to flip between 0 and 1, then submit your answer.

FIG. 1 — INPUT REGISTER
bit 7bit 0
— bit 7 on the left, bit 0 on the right —
FIG. 2 — MANUAL REVERSAL
0
0
0
0
0
0
0
0
bit 7bit 0
— tap each cell to toggle 0 / 1, then submit —