You are viewing a single comment's thread. Return to all comments →
function getMaxLessThanK(n, k){ let maxOfab = 0; for (let b = 1; b <= n; b++) { for (let a = 1; a < b; a++) { maxOfab = (a & b) < k && (a & b) > maxOfab ? a & b : maxOfab } } return maxOfab; }
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 →