n | def find(source, pattern): | n | def find_substring(input_string, template): |
| for i in range(len(source) - len(pattern) + 1): | | for i in range(len(input_string) - len(template) + 1): |
| suitable = True | | found = True |
| for j in range(len(pattern)): | | for j in range(len(template)): |
| if pattern[j] != '@' and pattern[j] != source[i + j]: | | if template[j] != '@' and template[j] != input_string[i + j]: |
| suitable = False | | found = False |
| break | | break |
n | if suitable: | n | if found: |
| return i | | return i |
| return -1 | | return -1 |
t | print(find(input(), input())) | t | print(find_substring(input(), input())) |