Skip to main content
3 of 4
deleted 62 characters in body
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

05AB1E, 16 15 14 bytes

0ÐIv(2Fy+Š])Äà

Port of @tsh' top Python answer.
-1 byte thanks to @Neil, which also allowed a second byte to be saved

Try it online or verify all test cases.

Explanation:

0Ð            # Push three 0s, let's call these a,b,c
  I           # Push the input-list
   v          # Pop and loop over each item `y`:
    (         #  Negate the top item
     2F       #  Loop 2 times:
       y+     #   Add the current integer `y` to the top
         Š    #   Tripleswap x,y,z to z,x,y
              #  (after this inner loop, a,b,c is y+b,y-c,a)
   ]          # Close both loops
    )         # Wrap all three values into a list
     Ä        # Get the absolute values of each
      à       # Pop and push the maximum
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384