You are viewing a single comment's thread. Return to all comments →
Wow i really went the hard route ay, forgot about dictionaries.
import re no_strings = int(input()) strings = [] no_q = 0 queries = [] for _ in range(no_strings): strings.append(input()) no_q = int(input()) for _ in range(no_q): queries.append(re.compile(r'^'+input()+'$')) for pattern in queries: found = 0 for s in strings: found += len(pattern.findall(s)) print(found)
Seems like cookies are disabled on this browser, please enable them to open this website
Sparse Arrays
You are viewing a single comment's thread. Return to all comments →
Wow i really went the hard route ay, forgot about dictionaries.