You are viewing a single comment's thread. Return to all comments →
public static long flippingBits(long n) { // Create a mask with all bits set to 1 long mask = 0xFFFFFFFFL; // Flip all bits using XOR operation return n ^ mask; }
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 →