eolymp
bolt
Try our new interface for solving problems

KMP

Zaman məhdudiyyəti 0.1 saniyə
Yaddaşı istafadə məhdudiyyəti 128 MiB

Find all occurrences of the string word in the string text.

Giriş verilənləri

The first line contains the string text, the second line contains the string word. The length of each string is greater than 0 and less than 50000, the strings contain only latin letters.

Çıxış verilənləri

Print the position numbers from which the string word starts in a string text in ascending order. As is usually in programming, the string positions start from zero.

Nümunə

Giriş verilənləri #1
ababbababa
aba
Çıxış verilənləri #1
0 5 7
Mənbə KMP, Classic