You are viewing a single comment's thread. Return to all comments →
Java 8
public static int bitwiseAnd(int N, int K) { // Write your code here int ret=0; for(int A=1;A<N;A++) { for(int B=A+1;B<=N;B++) { if((A&B)<K) { ret=Math.max(ret, A&B); } }
} return ret; }
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