Flipping bits

  • + 0 comments

    Javscript solution

    • ~ Flips all the bits of the input n.
    • >>> Ensures the result is treated as an unsigned 32-bit integer
    function flippingBits(n) {
        // Write your code here
        return ~n  >>> 0
    }