Pattern Recognition Drill
Easy Bit Manipulation
The Problem
Reverse the bits of a 32-bit unsigned integer.
What approach would you use?
Think about it before scrolling down.
Loop 32 times: result = (result << 1) | (n & 1); n >>= 1. O(32) = O(1).
Common Trap
This is bit-level reversal, not byte-level. Process each bit individually.