You are viewing a single comment's thread. Return to all 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(); }
Seems like cookies are disabled on this browser, please enable them to open this website
Flipping bits
You are viewing a single comment's thread. Return to all comments →
A simple attempt using C++ bitset