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