Skip to main content
Rollback to Revision 2
Source Link
Natte
  • 1.1k
  • 5
  • 9

Husk, 14 13 1013 bytes

-1 byte thanks to Dominic van Essen
-3 bytes thanks to Jonathan Allan's trick

►Ofo=▲¹Σπ3◄§-▼▲fo=▲¹Σπ3

Try it online!Try it online!

Explanation

►Ofo=▲¹Σπ3◄§-▼▲fo=▲¹Σπ3
           π3     cartesian product of 3 * input
     fo          filter by composed function
     ▲¹  =▲¹Σ      max of input
  equals sum
◄§  =  Σ     equals sum
►     min by composed binary function
  -▼▲ max by
 O         max - sortedmin

Husk, 14 13 10 bytes

-1 byte thanks to Dominic van Essen
-3 bytes thanks to Jonathan Allan's trick

►Ofo=▲¹Σπ3

Try it online!

Explanation

►Ofo=▲¹Σπ3
        π3   cartesian product of 3 * input
  fo         filter by composed function
     ▲¹      max of input
     =  Σ     equals sum
►            max by
 O           sorted

Husk, 14 13 bytes

-1 byte thanks to Dominic van Essen

◄§-▼▲fo=▲¹Σπ3

Try it online!

Explanation

◄§-▼▲fo=▲¹Σπ3
           π3     cartesian product of 3 * input
     fo          filter by composed function
       =▲¹Σ      max of input equals sum
◄§               min by composed binary function
  -▼▲            max - min
-3 bytes (Jonathan Allan)
Source Link
Natte
  • 1.1k
  • 5
  • 9

Husk, 14 1313 10 bytes

-1 byte thanks to Dominic van Essen
-3 bytes thanks to Jonathan Allan's trick

◄§-▼▲fo=▲¹Σπ3►Ofo=▲¹Σπ3

Try it online!Try it online!

Explanation

◄§-▼▲fo=▲¹Σπ3►Ofo=▲¹Σπ3
           π3     cartesian product of 3 * input
     fo          filter by composed function
       =▲¹Σ▲¹      max of input 
 equals sum
◄§  =  Σ     equals sum
►     min by composed binary function
  -▼▲ max by
 O         max - minsorted

Husk, 14 13 bytes

-1 byte thanks to Dominic van Essen

◄§-▼▲fo=▲¹Σπ3

Try it online!

Explanation

◄§-▼▲fo=▲¹Σπ3
           π3     cartesian product of 3 * input
     fo          filter by composed function
       =▲¹Σ      max of input equals sum
◄§               min by composed binary function
  -▼▲            max - min

Husk, 14 13 10 bytes

-1 byte thanks to Dominic van Essen
-3 bytes thanks to Jonathan Allan's trick

►Ofo=▲¹Σπ3

Try it online!

Explanation

►Ofo=▲¹Σπ3
        π3   cartesian product of 3 * input
  fo         filter by composed function
     ▲¹      max of input 
    =  Σ     equals sum
►            max by
 O           sorted
-1 byte (Dominic van Essen)
Source Link
Natte
  • 1.1k
  • 5
  • 9

Husk, 1414 13 bytes

-1 byte thanks to Dominic van Essen

◄§-▼▲fo=▲¹ΣΠR3▼▲fo=▲¹Σπ3

Try it online!Try it online!

Explanation

◄§-▼▲fo=▲¹ΣΠR3▼▲fo=▲¹Σπ3
            R3   repeat input 3 times
       π3    Π cartesian product of 3 cartesian* productinput
     fo          filter by composed function
       =▲¹Σ      max of input equals sum
◄§               min by composed binary function
  -▼▲            max - min

Husk, 14 bytes

◄§-▼▲fo=▲¹ΣΠR3

Try it online!

Explanation

◄§-▼▲fo=▲¹ΣΠR3
            R3   repeat input 3 times
           Π     cartesian product
     fo          filter by composed function
       =▲¹Σ      max of input equals sum
◄§               min by composed binary function
  -▼▲            max - min

Husk, 14 13 bytes

-1 byte thanks to Dominic van Essen

◄§-▼▲fo=▲¹Σπ3

Try it online!

Explanation

◄§-▼▲fo=▲¹Σπ3
           π3     cartesian product of 3 * input
     fo          filter by composed function
       =▲¹Σ      max of input equals sum
◄§               min by composed binary function
  -▼▲            max - min
Source Link
Natte
  • 1.1k
  • 5
  • 9
Loading