Divide and Conquer
Bit Manipulation
Reverse bits of a given 32 bits unsigned integer.
Note:
Examples
Example 1
Input: n = 43261596
Output: 964176192
Explanation:
Example 2
Input: n = 2147483644
Output: 1073741822
Explanation:
Constraints
0 <= n <= 231 - 2n is even.
Follow Up
- If this function is called many times, how would you optimize it?