I've added 4 medium and 1 hard challenge to codr's ranked mode. All of these are related to basic logic and mathematics, the perfect occupation on a sunny Sunday afternoon. Visit codr for more https://nevolin.be/codr/
Can you solve the hard one?
function POF(num) {
if (num === 1) return true;
if (num < 4) return false;
if ((num & (num - 1)) !== 0) return false;
return (num & 0x55555555) === num;
}
let A = POF(258);
// A = ?
Top comments (0)