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