You are viewing a single comment's thread. Return to all comments →
public static String counterGame(long n) { int bits = Long.bitCount(n); int trailingZeros = Long.numberOfTrailingZeros(n);
return (bits - 1 + trailingZeros) % 2 == 0 ? "Richard" : "Louise";
} `
Seems like cookies are disabled on this browser, please enable them to open this website
Counter game
You are viewing a single comment's thread. Return to all comments →
public static String counterGame(long n) { int bits = Long.bitCount(n); int trailingZeros = Long.numberOfTrailingZeros(n);
} `