You are viewing a single comment's thread. Return to all comments →
This code passes only the first test case. Can't see anything wrong with the code or the pattern:
import re sentences = "".join([input() for _ in range(int(input()))]) words = [input() for _ in range(int(input()))] for w in words: regex = f"\\b{w}\\b" try: print(len(re.findall(regex, sentences))) except TypeError: print(0)
Seems like cookies are disabled on this browser, please enable them to open this website
Find a Word
You are viewing a single comment's thread. Return to all comments →
This code passes only the first test case. Can't see anything wrong with the code or the pattern: