Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Speedy category for Find Sequence by LPFS
import re
def checkio(matrix):
nofCols = len(matrix[0])
patternS = r'(\d)(?:.{%d}\%d){3}'
coeffs = (0,nofCols-1,nofCols,nofCols+1)
pattern = '|'.join([patternS%(coeff,i+1) for i,coeff in enumerate(coeffs)])
s = 'n'.join([''.join([str(cell) for cell in row]) for row in matrix])
return bool(re.search(pattern,s))
Feb. 21, 2019