Skip to main content
added 485 characters in body
Source Link
Jitse
  • 7.7k
  • 3
  • 19
  • 43

Python 3, 82 bytes

f=lambda a,*b:[*b]and[min([sum((x-y)**2for x,y in zip(a,q))**.5for q in b]+f(*b))]

Try it online!


Python 3 with SciPy, 58 bytes

lambda*a:min(pdist(a))
from scipy.spatial.distance import*

Try it online!

Python 3, 82 bytes

f=lambda a,*b:[*b]and[min([sum((x-y)**2for x,y in zip(a,q))**.5for q in b]+f(*b))]

Try it online!

Python 3, 82 bytes

f=lambda a,*b:[*b]and[min([sum((x-y)**2for x,y in zip(a,q))**.5for q in b]+f(*b))]

Try it online!


Python 3 with SciPy, 58 bytes

lambda*a:min(pdist(a))
from scipy.spatial.distance import*

Try it online!

Source Link
Jitse
  • 7.7k
  • 3
  • 19
  • 43

Python 3, 82 bytes

f=lambda a,*b:[*b]and[min([sum((x-y)**2for x,y in zip(a,q))**.5for q in b]+f(*b))]

Try it online!