AdvancedRating 1600
Every Place the Pattern Appears
Print every starting position (from 1) where the pattern occurs in the text, overlaps allowed, in increasing order. Print NONE if it never occurs. Use the Z-function or prefix function.
Input
The text, then the pattern.
Output
One line.
Sample 1
Input
abababa aba
Output
1 3 5
Sample 2
Input
aaaaa aa
Output
1 2 3 4
Output appears here