PatternFind/s02190230 | PatternFind/SVasi1yev | ||||
---|---|---|---|---|---|
n | 1 | check = input() | n | 1 | string = input() |
2 | pattern = input() | 2 | pattern = input() | ||
n | 3 | for i in range(len(check) - len(pattern) + 1): | n | 3 | for i in range(len(string) - 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 | ||||
7 | elif check[i + j] != pattern[j]: | 6 | if string[i + j] != pattern[j]: | ||
8 | break | 7 | break | ||
9 | else: | 8 | else: | ||
10 | print(i) | 9 | print(i) | ||
11 | break | 10 | break | ||
12 | else: | 11 | else: | ||
13 | print(-1) | 12 | print(-1) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|