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