You are viewing a single comment's thread. Return to all comments →
python
def gridSearch(G, P): for i in range(len(G) - len(P) + 1): first_line = re.finditer(f'(?={P[0]})', G[i]) rest_lines = [] for line in range(1, len(P)): rest_lines.append(list(match.start() for match in re.finditer(f'(?={P[line]})', G[i + line]))) for match in first_line: if all(match.start() in result for result in rest_lines): 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 →
python