You are viewing a single comment's thread. Return to all comments →
In C#
public static int bitwiseAnd(int N, int K) { int maxVal = 0; for(int a = 1; a < N; a++) { for(int b = a + 1; b <= N; b++) { int ab = a & b; if(ab < K && ab > maxVal) maxVal = ab; } } return maxVal; }
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 →
In C#