Skip to main content
Rollback to Revision 1
Source Link

Jelly (fork), 11 911 bytes

ṗ3SƘṀṢ€ṢṪṗ3SƘṀṀ_ṂƊÞḢ

Try it online!Try it online! (this is the equivalent in normal Jelly)

This uses my fork of Jelly which includes the Ƙ (keep-like) quick to replace the commonly used <link>⁼¥Ƈ pattern. You can see this in the TIO link.

-2 bytes thanks to Jonathan Allan by using the sorting trick from his answer!

How it works

ṗ3SƘṀṢ€ṢṪṗ3SƘṀṀ_ṂƊÞḢ - Main link. Takes a list L on the left
ṗ3          - Cartesian Cube
    Ṁ       - Maximum of L
   Ƙ        - Keep triples whose     is like the maximum
  S         -                    sum
     Ṣ€   ƊÞ  - Sort eachthe remaining triples by:
           - Sort  maximum
      _     -   minus
       -   minimum
          Ḣ - Take the last onefirst

Jelly (fork), 11 9 bytes

ṗ3SƘṀṢ€ṢṪ

Try it online! (this is the equivalent in normal Jelly)

This uses my fork of Jelly which includes the Ƙ (keep-like) quick to replace the commonly used <link>⁼¥Ƈ pattern. You can see this in the TIO link.

-2 bytes thanks to Jonathan Allan by using the sorting trick from his answer!

How it works

ṗ3SƘṀṢ€ṢṪ - Main link. Takes a list L on the left
ṗ3        - Cartesian Cube
    Ṁ     - Maximum of L
   Ƙ      - Keep triples whose     is like the maximum
  S       -                    sum
     Ṣ€   - Sort each
         - Sort
         - Take the last one

Jelly (fork), 11 bytes

ṗ3SƘṀṀ_ṂƊÞḢ

Try it online! (this is the equivalent in normal Jelly)

This uses my fork of Jelly which includes the Ƙ (keep-like) quick to replace the commonly used <link>⁼¥Ƈ pattern. You can see this in the TIO link.

How it works

ṗ3SƘṀṀ_ṂƊÞḢ - Main link. Takes a list L on the left
ṗ3          - Cartesian Cube
    Ṁ       - Maximum of L
   Ƙ        - Keep triples whose     is like the maximum
  S         -                    sum
        ƊÞ  - Sort the remaining triples by:
           -   maximum
      _     -   minus
       -   minimum
          Ḣ - Take the first
added 43 characters in body
Source Link

Jelly (fork), 1111 9 bytes

ṗ3SƘṀṀ_ṂƊÞḢṗ3SƘṀṢ€ṢṪ

Try it online!Try it online! (this is the equivalent in normal Jelly)

This uses my fork of Jelly which includes the Ƙ (keep-like) quick to replace the commonly used <link>⁼¥Ƈ pattern. You can see this in the TIO link.

-2 bytes thanks to Jonathan Allan by using the sorting trick from his answer!

How it works

ṗ3SƘṀṀ_ṂƊÞḢṗ3SƘṀṢ€ṢṪ - Main link. Takes a list L on the left
ṗ3          - Cartesian Cube
    Ṁ       - Maximum of L
   Ƙ        - Keep triples whose     is like the maximum
  S         -                    sum
       Ṣ€ ƊÞ  - Sort the remaining triples by:
     Ṁ      -   maximum
      _     -   minuseach
          -   minimumSort
           - Take the firstlast one

Jelly (fork), 11 bytes

ṗ3SƘṀṀ_ṂƊÞḢ

Try it online! (this is the equivalent in normal Jelly)

This uses my fork of Jelly which includes the Ƙ (keep-like) quick to replace the commonly used <link>⁼¥Ƈ pattern. You can see this in the TIO link.

How it works

ṗ3SƘṀṀ_ṂƊÞḢ - Main link. Takes a list L on the left
ṗ3          - Cartesian Cube
    Ṁ       - Maximum of L
   Ƙ        - Keep triples whose     is like the maximum
  S         -                    sum
        ƊÞ  - Sort the remaining triples by:
     Ṁ      -   maximum
      _     -   minus
          -   minimum
           - Take the first

Jelly (fork), 11 9 bytes

ṗ3SƘṀṢ€ṢṪ

Try it online! (this is the equivalent in normal Jelly)

This uses my fork of Jelly which includes the Ƙ (keep-like) quick to replace the commonly used <link>⁼¥Ƈ pattern. You can see this in the TIO link.

-2 bytes thanks to Jonathan Allan by using the sorting trick from his answer!

How it works

ṗ3SƘṀṢ€ṢṪ - Main link. Takes a list L on the left
ṗ3        - Cartesian Cube
    Ṁ     - Maximum of L
   Ƙ      - Keep triples whose     is like the maximum
  S       -                    sum
     Ṣ€   - Sort each
         - Sort
         - Take the last one
Source Link

Jelly (fork), 11 bytes

ṗ3SƘṀṀ_ṂƊÞḢ

Try it online! (this is the equivalent in normal Jelly)

This uses my fork of Jelly which includes the Ƙ (keep-like) quick to replace the commonly used <link>⁼¥Ƈ pattern. You can see this in the TIO link.

How it works

ṗ3SƘṀṀ_ṂƊÞḢ - Main link. Takes a list L on the left
ṗ3          - Cartesian Cube
    Ṁ       - Maximum of L
   Ƙ        - Keep triples whose     is like the maximum
  S         -                    sum
        ƊÞ  - Sort the remaining triples by:
     Ṁ      -   maximum
      _     -   minus
       Ṃ    -   minimum
          Ḣ - Take the first