Given a 32-bit unsigned integer , reverse its bits. For example, if (binary ), return (binary ).
Reversing bits means the leftmost bit becomes the rightmost, the second-left becomes second-right, and so on. This is not the same as reversing the decimal representation.
Think about how you can build the reversed number bit by bit. You extract each bit from (right to left) and place it into the result (left to right). Before reading on, try to design an algorithm.