PatternFind/SVasi1yev | PatternFind/s02190230 | ||||
---|---|---|---|---|---|
n | 1 | string = input() | n | 1 | check = input() |
2 | pattern = input() | 2 | pattern = input() | ||
n | 3 | for i in range(len(string) - len(pattern) + 1): | n | 3 | for i in range(len(check) - len(pattern) + 1): |
4 | for j in range(len(pattern)): | 4 | for j in range(len(pattern)): | ||
t | 5 | if pattern[j] != '@': | t | 5 | if pattern[j] == '@': |
6 | continue | ||||
6 | if string[i + j] != pattern[j]: | 7 | elif check[i + j] != pattern[j]: | ||
7 | break | 8 | break | ||
8 | else: | 9 | else: | ||
9 | print(i) | 10 | print(i) | ||
10 | break | 11 | break | ||
11 | else: | 12 | else: | ||
12 | print(-1) | 13 | print(-1) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|