Given an unsigned 32-bit integer n, return the unsigned integer produced by reversing its bit order. Bit 0 becomes bit 31, bit 1 becomes bit 30, and so on. Implement a function that operates on exactly 32 bits.
Constraints
0 <= n <= 2^32 - 1
Treat n as an unsigned 32-bit integer
The solution must reverse exactly 32 bits
Function Signature
defreverse_bits(n):
Interviewer
Whenever you're ready, walk me through your approach or go straight to the code. The requirements are in the Question tab.