Schneider Electric Interview Question

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