You are viewing a single comment's thread. Return to all comments →
import re b = [] for _ in range(int(input())): a = input() b.extend(re.findall(r"\b[a-zA-Z]+(?:ze|se)\b", a)) c = int(input()) queries = [input().strip() for _ in range(c)] for q in queries: british = q[:-2] + "se" count = b.count(q) + b.count(british) print(count)
Seems like cookies are disabled on this browser, please enable them to open this website
The British and American Style of Spelling
You are viewing a single comment's thread. Return to all comments →