You are viewing a single comment's thread. Return to all comments →
function bitwiseAnd(N: number, K: number): number { let max = 0; let aANDb; for (let a = 1; a < N; a++) { for (let b = a + 1; b <= N; b++) { aANDb = a & b; if ((aANDb) < K && (aANDb) > max) { max = aANDb; } } } 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/TypeScript