Reverse Bits
Treat n as a 32 bit unsigned number. Reverse the order of its 32 bits and return the resulting number. For example, a number with only the lowest bit set becomes a number with only the highest bit set.
Example 1
n 1
returns 2147483648
1 becomes 2**31 = 2147483648.
Example 2
n 6
returns 1610612736
...0110 becomes 0110... which is 1610612736.
Constraints
0 <= n < 2**32
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.