abcabcabc abc
The pattern abc appears in abcabcabc starting at positions 1, 4, and 7.
3 1 4 7
aaaa aa
The pattern aa appears in aaaa starting at positions 1, 2, and 3. Overlapping matches are counted.
3 1 2 3
abcdef xyz
The pattern xyz does not appear in abcdef, so there are no positions to print.
0
Given a text string TTT and a pattern string PPP, find all occurrences of PPP in TTT.
Report the total number of matches and the starting positions (1-indexed) of each occurrence.