Гончаров Илья, 321 группа ShuffleString 2168 | Шагов Виталий 521 ShuffleString 2023 | ||||
---|---|---|---|---|---|
t | 1 | s1, s2 = (input(), input()) | t | 1 | n, m = (input(), input()) |
2 | for i in range(1, len(s1)): | 2 | for i in range(1, len(n)): | ||
3 | if ''.join([s1[j::i] for j in range(i)]) == s2: | 3 | if ''.join([n[j::i] for j in range(i)]) == m: | ||
4 | print(i) | 4 | print(i) | ||
5 | break | 5 | break | ||
6 | else: | 6 | else: | ||
7 | print('No') | 7 | print('No') |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|