You are viewing a single comment's thread. Return to all comments →
No need for regex, at least not in Python:
n = int(input()) text = "" for _ in range(n): text += " " + input() t = int(input()) for _ in range(t): american = input() british = american[:-2] + 'se' count = text.count(american) + text.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 →
No need for regex, at least not in Python: