You are viewing a single comment's thread. Return to all comments →
function getMaxLessThanK(n, k) { let max = 0; let s = []; max = 0; for (let a = 1; a <= n; a++) { s.push(a); for (let b = a + 1; b <= n; b++) { let bit = a & b; if (bit < k && bit > max) { max = bit; } } } return max; }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 6: Bitwise Operators
You are viewing a single comment's thread. Return to all comments →