You are viewing a single comment's thread. Return to all comments →
import re n_lines = int(input()) test_string = '\n'.join([input() for _ in range(n_lines)]) substring_list = [] n_substrings = int(input()) for _ in range(n_substrings): substring_list.append(input()) for substring in substring_list: print(len(re.findall(f'\\w+({substring})\\w+', test_string)))
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 →