one line solution in JavaScript (ES8)


  • 0
    var reverseBits = function(n) {
        return parseInt(n.toString(2).padStart(32, "0").split("").reverse().join(""), 2);
    };
    

Log in to reply
 

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