You are viewing a single comment's thread. Return to all comments →
Java 8
public static int bitwiseAnd(int N, int K) { int max = 0; for (int i = 1; i <= N; i++) { for (int j = i + 1; j <= N; j++) { int tmp = i&j; if (tmp < K && tmp > max) { max = tmp; } } } return max; }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 29: Bitwise AND
You are viewing a single comment's thread. Return to all comments →
Java 8