Schneider Electric interview question

Find the minimum distance between given two elements in an array.