Skip to main content
added 104 characters in body
Source Link
Ethan
  • 455
  • 2
  • 9

PHP, 3737 36 bytes

<?=substr_count=1&~substr_count(decbin($argn),1)%2<1;;

To run it:

echo '<input>' | php -nF <filename>

Or Try it online!Try it online!

Prints 1 for true, and nothing0 for false.

-1 byte thanks to Benoit Esnard!

PHP, 37 bytes

<?=substr_count(decbin($argn),1)%2<1;

To run it:

echo '<input>' | php -nF <filename>

Or Try it online!

Prints 1 for true, and nothing for false.

PHP, 37 36 bytes

<?=1&~substr_count(decbin($argn),1);

To run it:

echo '<input>' | php -nF <filename>

Or Try it online!

Prints 1 for true, and 0 for false.

-1 byte thanks to Benoit Esnard!

Source Link
Ethan
  • 455
  • 2
  • 9

PHP, 37 bytes

<?=substr_count(decbin($argn),1)%2<1;

To run it:

echo '<input>' | php -nF <filename>

Or Try it online!

Prints 1 for true, and nothing for false.