Skip to main content
Commonmark migration
Source Link

#Pyth, 6 bytes

Pyth, 6 bytes

/Q/sQ2

Try it online!

Expects input as a list of integers. Outputs 0 if no number can be built by subtracting the other two and >0 if at least one can.

###Explanation:

Explanation:

Same algorithm as the answer of @xnor

/Q/sQ2

   sQ     # Sum all elements in the list
  /  2    # Divide the sum by 2
/Q        # Count Occurences of above number in the list

#Pyth, 6 bytes

/Q/sQ2

Try it online!

Expects input as a list of integers. Outputs 0 if no number can be built by subtracting the other two and >0 if at least one can.

###Explanation:

Same algorithm as the answer of @xnor

/Q/sQ2

   sQ     # Sum all elements in the list
  /  2    # Divide the sum by 2
/Q        # Count Occurences of above number in the list

Pyth, 6 bytes

/Q/sQ2

Try it online!

Expects input as a list of integers. Outputs 0 if no number can be built by subtracting the other two and >0 if at least one can.

Explanation:

Same algorithm as the answer of @xnor

/Q/sQ2

   sQ     # Sum all elements in the list
  /  2    # Divide the sum by 2
/Q        # Count Occurences of above number in the list
Source Link
Denker
  • 6.9k
  • 1
  • 25
  • 69

#Pyth, 6 bytes

/Q/sQ2

Try it online!

Expects input as a list of integers. Outputs 0 if no number can be built by subtracting the other two and >0 if at least one can.

###Explanation:

Same algorithm as the answer of @xnor

/Q/sQ2

   sQ     # Sum all elements in the list
  /  2    # Divide the sum by 2
/Q        # Count Occurences of above number in the list