Flipping bits

  • + 0 comments

    C++ solution:

    long flippingBits(long n) {
        return ~static_cast<uint32_t>(n);
    }