Implement a function that reverses the bit order of a given 32-bit unsigned integer and returns its corresponding decimal representation.
n: number
: An integerInput: n = 8Output: 268435456Explanation: 8 in binary is 00000000000000000000000000001000. After reversing its bits, it becomes 00010000000000000000000000000000, which is 268435456 in decimal.
Input: n = 3Output: 3221225472Explanation: 3 in binary is 00000000000000000000000000000011. After reversing its bits, it becomes 11000000000000000000000000000000, which is 3221225472 in decimal.
Input: n = 0Output: 0Explanation: 0 in binary is 00000000000000000000000000000000. After reversing its bits, it becomes 00000000000000000000000000000000, which is 0 in decimal.
n
<= 1,000,000Implement a function that reverses the bit order of a given 32-bit unsigned integer and returns its corresponding decimal representation.
n: number
: An integerInput: n = 8Output: 268435456Explanation: 8 in binary is 00000000000000000000000000001000. After reversing its bits, it becomes 00010000000000000000000000000000, which is 268435456 in decimal.
Input: n = 3Output: 3221225472Explanation: 3 in binary is 00000000000000000000000000000011. After reversing its bits, it becomes 11000000000000000000000000000000, which is 3221225472 in decimal.
Input: n = 0Output: 0Explanation: 0 in binary is 00000000000000000000000000000000. After reversing its bits, it becomes 00000000000000000000000000000000, which is 0 in decimal.
n
<= 1,000,000console.log()
statements will appear here.