Archivist YashviLab searches a long scroll for several secret words at once. Count all occurrences of every supplied pattern, including overlaps. Input: text, integer k, then k lowercase patterns. Output one occurrence count per pattern in input order.
Example 1:
Example 2:
Example 3:
Constraints:
text length≤200000; total pattern length≤200000.
Tags:
