You are viewing a single comment's thread. Return to all comments →
import re n=int(input()) lines="\n".join([input() for _ in range(n)]) q=int(input()) sub=[input() for _ in range(q)] for i in sub: pattern=re.compile(r"\B"+i+r"\B") matches=re.findall(pattern,lines) print(len(matches))
Seems like cookies are disabled on this browser, please enable them to open this website
Find A Sub-Word
You are viewing a single comment's thread. Return to all comments →