@@ -0,0 +1,370 @@
+n = int(raw_input().strip())%0AA = map(int,raw_input().strip().split(' '))%0A%0Aminm = -1%0Afor dist in xrange(1, n, 1):%0A    for i in xrange(n):%0A        if i + dist %3E= n:%0A            break%0A        if A%5Bi%5D == A%5Bi+dist%5D:%0A            if minm == -1:%0A                minm = dist%0A                %0A            elif dist %3C minm:%0A                minm = dist%0A                %0Aprint minm %0A

Create solution.py