DEV Community

Cover image for 5 new challenges
Ilya Nevolin
Ilya Nevolin

Posted on

5 new challenges

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 = ?
Enter fullscreen mode Exit fullscreen mode

Top comments (0)