You are viewing a single comment's thread. Return to all comments →
public static int bitwiseAnd(int N, int K) { int max = 0; int compare = 0; for(int i = 1; i<N; i++) for(int j = i+1; j<=N; j++) { compare = i&j; max = max < compare && compare < K ? compare : max; } return max; }
Day 29: Bitwise AND
You are viewing a single comment's thread. Return to all comments →
C# Solution: