You are viewing a single comment's thread. Return to all comments →
n,list1,arr=int(input()),list(),list(map(int,input().split())) list1=[abs(arr.index(i)-arr.index(i,arr.index(i)+1)) for i in arr if arr.count(i)>=2] print(min(list1) if list1 else -1)
runs great as well
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 →
runs great as well