You are viewing a single comment's thread. Return to all comments →
Python 3 (using regex)
def gridSearch(G, P): string = "".join(G) separation = C-c if separation < 0: return "NO" pattern = fr'.{{{separation}}}'.join(P) for match in re.finditer(pattern, string): rows = (match.end()-1)//C - match.start()//C + 1 if rows == r: 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 3 (using regex)