Skip to main content
1 of 2
oeuf
  • 1.8k
  • 4
  • 18

K (ngn/k), 10 bytes

{#(2\x)^0}

Try it online!

Straightforward solution. Cast the number into base 2, remove all the 0s, then return the length of the array.

oeuf
  • 1.8k
  • 4
  • 18