Go minDistance() The minDistance() returns minimum distance between any two equal elements in the slice. If no such elements exist, it returns -1.