We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
var out_max = 0;
var out = 0;
for (let i=1; i < n; i++) {
for (let j=0; j < (n-i); j++) {
out = i & (i+1)+j; // think of a=i and b=(i+1)+j
if (out < k && out > out_max) {
out_max = out;
}
}
}
return out_max;
}
Cookie support is required to access HackerRank
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 →
function getMaxLessThanK(n, k) {
}