![]() |
Given a positive 32-bit integer N, the task is to find the maximum between the value of N and the number obtained by decimal representation of reversal of binary representation of N in a 32-bit integer. Examples:
Approach: Follow the steps below to solve the problem:
Below is the implementation of the above approach: C++
Java
Python3
C#
Javascript
Output:
1610612736
Time Complexity: O(32)
|
Reffered: https://www.geeksforgeeks.org
Bit Magic |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 11 |