Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Find Sequence by a.a.v.worker
def checkio(matrix, l=3):
q = range(len(matrix))
ls = lambda x:len(set(x))
for i in q:
for j in q:
if i+l in q and ls([matrix[i+n][j] for n in range(4)])==1: return True
if j+l in q and ls([matrix[i][j+n] for n in range(4)])==1: return True
if j+l in q and i+l in q and ls([matrix[i+n][j+n] for n in range(4)])==1: return True
if j-l in q and i+l in q and ls([matrix[i+n][j-n] for n in range(4)])==1: return True
return False
Aug. 28, 2015
Comments: