You are viewing a single comment's thread. Return to all comments →
JavaScript Solution
function bitwiseAnd(N, K) { let max = 0; for(let i = 1; i <= N; i++) { for(let j = N; j > i; j--) { let bitAndOp = i & j; if(bitAndOp > max && bitAndOp < K ) { max = bitAndOp; } } } 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 →
JavaScript Solution