Don't mess up its easy see here [c++]


#1
#include<bits/stdc++.h>
using namespace std; 
unsigned int Solution::reverse(unsigned int N) {
 
      string A = bitset<32>(N).to_string();
      unsigned int b = 0 ; 
      
      for( int i = 0 ; i < 32 ; i++ )
      if( A[i] == '1' )b |= 1<<i ;
      
      return b ;
}