You are viewing a single comment's thread. Return to all comments →
**PYTHON **
d=[] for i in range(len(a)): for j in range(len(a)): if a[i]==a[j] and abs(i-j) not in d and abs(i-j)!=0: d.append(abs(i-j)) if bool(d)==False: return -1 else: return min(d)
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 →
**PYTHON **