You are viewing a single comment's thread. Return to all comments →
python3
def gridSearch(grid, pattern): gRows, pRows = len(grid), len(pattern) for gRow in range(pRows-1, gRows): for item in re.finditer(pattern[-1], grid[gRow]): x1, x2 = item.start(), item.end() if all([grid[gRow+1-pRows+y][x1 : x2] == pattern[y] for y in range(pRows-1)]): return "YES" return "NO"
Seems like cookies are disabled on this browser, please enable them to open this website
The Grid Search
You are viewing a single comment's thread. Return to all comments →
python3