Period of first differences by Defenestrator

while 1:a=map(int,raw_input().split());n=map(int.__sub__,a[1:],a[:-1]);print[n[i:]==n[:-i]for i in range(len(n))].index(1)

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page