PatternFind/akozlov | PatternFind/s02190253 | ||||
---|---|---|---|---|---|
f | 1 | s = input() | f | 1 | s = input() |
2 | pattern = input() | 2 | pattern = input() | ||
n | 3 | for i in range(len(s) - len(pattern) + 1): | n | 3 | for pattern_start in range(len(s) - len(pattern) + 1): |
4 | for j in range(len(pattern)): | 4 | for i in range(len(pattern)): | ||
5 | if s[i + j] != pattern[j] and pattern[j] != '@': | 5 | if s[pattern_start + i] != pattern[i] and pattern[i] != '@': | ||
6 | break | 6 | break | ||
7 | else: | 7 | else: | ||
t | 8 | print(i) | t | 8 | print(pattern_start) |
9 | break | 9 | break | ||
10 | else: | 10 | else: | ||
11 | print(-1) | 11 | print(-1) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|