PatternFind/biryukov.andrej | PatternFind/jammer312 | ||||
---|---|---|---|---|---|
n | 1 | string = input() | n | 1 | haystack = input() |
2 | temp = input() | 2 | needle = input() | ||
3 | for i in range(len(string) - len(temp) + 1): | 3 | for index in range(len(haystack) - len(needle) + 1): | ||
4 | for j in range(len(temp)): | 4 | for offset in range(len(needle)): | ||
5 | if temp[j] != '@': | 5 | if needle[offset] != '@' and needle[offset] != haystack[index + offset]: | ||
6 | if temp[j] != string[j + i]: | ||||
7 | break | 6 | break | ||
8 | else: | 7 | else: | ||
t | 9 | print(i) | t | 8 | print(index) |
10 | break | 9 | break | ||
11 | else: | 10 | else: | ||
12 | print(-1) | 11 | print(-1) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|