Premium problem52. Point-by-Point Distances

Medium Locked

Z is an (n, 2) array of coordinates. Return the (n, n) matrix of pairwise Euclidean distances.

Input

[[0. 0.]
 [3. 4.]
 [6. 8.]]

Output

[[ 0.  5. 10.]
 [ 5.  0.  5.]
 [10.  5.  0.]]

Premium problem

This one's part of Premium. Unlock the full NumPy track plus every other premium problem on the site.

Implement solve(...)