You are viewing a single comment's thread. Return to all comments →
def minimum_distances(a): minimum = -1 for i in range(len(a)): for j in range(i+1, len(a)): if a[i] == a[j]: minimum = min(minimum, j-i) if minimum > 0 else j-i break return minimum
Seems like cookies are disabled on this browser, please enable them to open this website
Minimum Distances
You are viewing a single comment's thread. Return to all comments →