Reverse Bits in Java


  • 0
    R
    public int reverseBits(int n) {
            String s = Integer.toBinaryString(n);
            int i = Integer.reverse(n);
            
            return i;
        }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.