3ms c solution by bit


  • 0
    4

    uint32_t reverseBits(uint32_t n) {
    uint32_t r = 0;
    int t = 32;
    while (t > 0)
    {
    r = (r<<1) + (n&1);
    n = n>>1;
    t--;
    }
    return r;
    }


Log in to reply
 

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