Substring Search
(Time limit: 0,2 sec. Memory limit: 16 MB Difficulty: 38%)
Find all occurrences of the string P in the string T.
Input
The first line of input contains the string T, the second line of input contains the string P. Both strings consist of English letters only. The lengths of the strings are 1 to 5×104 inclusive.
Output
Output all zero-based positions of the string P in the string T in ascending order.
Sample
# | INPUT.TXT | OUTPUT.TXT |
1 | ababbababa aba | 0 5 7 |
Для отправки решения задачи необходимо зарегистрироваться и авторизоваться!
|