Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Find Sequence by m.dziardziel
def checkio(matrix):
for y in range(0,len(matrix)):
for x in range(0, len(matrix)):
i=3
if x<=len(matrix)-4:
while matrix[y][x]==matrix[y][x+i] and i>0:
i=i-1
if i==0:
return True
else:
i=3
if y<=len(matrix)-4:
while matrix[y][x]==matrix[y+i][x] and i>0:
i=i-1
if i==0:
return True
else:
i=3
if y<=len(matrix)-4 and x<=len(matrix)-4:
while matrix[y][x]==matrix[y+i][x+i] and i>0:
i=i-1
if i==0:
return True
else:
i=3
if x>=len(matrix)-4 and y<=len(matrix)-4:
while matrix[y][x]==matrix[y+i][x-i] and i>0:
i=i-1
if i==0:
return True
else:
i=3
return False
Nov. 14, 2016