from time import clock def func(temp): i=0 while i<26: j=0 check=[0]*91 while j<26: c=ord(temp[i][j]) if check[c]==0: check[c]=1 else: return 1 j+=1 i+=1 i=0 while i<26: j=0 check=[0]*91 while j<26: c=ord(temp[j][i]) if check[c]==0: check[c]=1 else: return 1 j+=1 i+=1 return 0 f=open("in8_9.txt","r") f1=open("in_8_9.txt","w") temp=f.readlines() start=clock() value=func(temp) ela=clock()-start f1.write(str(value)+"\ntime taken : "+str(ela))