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