📘
Reverse Bits
EasyBit Manipulation
Given a 32-bit unsigned integer, reverse its bits and return the resulting integer.
Example:
Input:
43261596
Output:
964176192
Reasoning:
- The input integer 43261596 is first converted to its binary representation: 1010100000101000000001011001000
- The bits are then reversed, resulting in the binary number: 00100101100000001010000001010101
- This reversed binary number is then converted back to an integer, which can be calculated as: 231+226+219+216+214+212+28+25+22=964176192
- The final output is 964176192
Constraints:
- Input is a 32-bit unsigned integer
Editor
Python 3.13.1
Test Results
0/0Run code to see test results.