Given a non-negative integer n, write a program to return the number obtained after reversing the bits of n.
- Actual binary representation of the number is being considered for reversing the bits, no leading 0’s are being considered.
Input: 13 Output: 11 Explanation: Binary representation of 13 is 1101. After reversing the bits we get 1011 which is equal to 11.
Input: 6 Output: 3 Explanation: Binary representation of 6 is 110.After reversing the bits we get 011 which is equal to 3.