Finding an array that is at minimum distance from a group of arrays.