3-Line C# Solution


  • 0
    L
    public uint reverseBits(uint n) {
        uint result = 0;
        for (int i = 0; i < 32; result = result << 1 | (n & 1), n >>= 1, ++i);
        return result;
    }

Log in to reply
 

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