Skip to main content
added 34 characters in body
Source Link
ovs
  • 60.6k
  • 3
  • 47
  • 161

05AB1E, 8 bytes

œ€ü-nOtß

Try it online!

Commented:

œ         # take all permutations of the input
 €        # for each permutation:
   -      #   take the element-wise difference
  ü       #   between each pair of adjacent points
    n     # square each number
     O    # sum all difference-lists
      t   # take the square root of every sum
       ß  # take the minimum
œ         # take all permutations of the input
 €        # for each permutation:
   -      #   take the element-wise difference
  ü       #   between each pair of adjacent points
    n     # square each number
     O    # sum all difference-lists
      t   # take the square root of every sum
       ß  # take the minimum

05AB1E, 8 bytes

œ€ü-nOtß

Try it online!

Commented:

œ         # take all permutations of the input
 €        # for each permutation:
   -      #   take the element-wise difference
  ü       #   between each pair of adjacent points
    n     # square each number
     O    # sum all difference-lists
      t   # take the square root of every sum
       ß  # take the minimum

05AB1E, 8 bytes

œ€ü-nOtß

Try it online!

Commented:

œ         # take all permutations of the input
 €        # for each permutation:
   -      #   take the element-wise difference
  ü       #   between each pair of adjacent points
    n     # square each number
     O    # sum all difference-lists
      t   # take the square root of every sum
       ß  # take the minimum
Source Link
ovs
  • 60.6k
  • 3
  • 47
  • 161

05AB1E, 8 bytes

œ€ü-nOtß

Try it online!

Commented:

œ         # take all permutations of the input
 €        # for each permutation:
   -      #   take the element-wise difference
  ü       #   between each pair of adjacent points
    n     # square each number
     O    # sum all difference-lists
      t   # take the square root of every sum
       ß  # take the minimum