• + 0 comments

    A simple attempt using C++ bitset

    long flippingBits(long n) { std::bitset<32> bits(n); for(int i=0;i<32;i++){ bits.flip(i);
    } return bits.to_ullong(); }