Minimum sum of squared Euclidean distance between two arrays