25: Reverse bits

Given 32 bits unsigned integer, write a method to reverse bits

 

Example 1

Input: 1

Output: 2147483648

Explanation: 1 = 00000000 00000000 00000000 00000001, 2147483648 = 10000000 00000000 00000000 00000000

Example 2

Input: 7

Output: 3758096384
Difficulty:Easy
Topic:Bit manipulation
Problem #:25