Skip to main content
Commonmark migration
Source Link

#MathGolf, 6 bytes

MathGolf, 6 bytes

¥Σ(±1=

Try it online.

Explanation:

¥       # Take modulo-2 on each integer of the (implicit) input-list
 Σ      # Sum those
  (     # Decrease it by 1
   ±    # Take the absolute value
    1=  # And check whether this is equal to 1
        # (after which the entire stack joined together is output implicitly)

#MathGolf, 6 bytes

¥Σ(±1=

Try it online.

Explanation:

¥       # Take modulo-2 on each integer of the (implicit) input-list
 Σ      # Sum those
  (     # Decrease it by 1
   ±    # Take the absolute value
    1=  # And check whether this is equal to 1
        # (after which the entire stack joined together is output implicitly)

MathGolf, 6 bytes

¥Σ(±1=

Try it online.

Explanation:

¥       # Take modulo-2 on each integer of the (implicit) input-list
 Σ      # Sum those
  (     # Decrease it by 1
   ±    # Take the absolute value
    1=  # And check whether this is equal to 1
        # (after which the entire stack joined together is output implicitly)
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

#MathGolf, 6 bytes

¥Σ(±1=

Try it online.

Explanation:

¥       # Take modulo-2 on each integer of the (implicit) input-list
 Σ      # Sum those
  (     # Decrease it by 1
   ±    # Take the absolute value
    1=  # And check whether this is equal to 1
        # (after which the entire stack joined together is output implicitly)