LearnPy Hub
← Arena
IntermediateRating 1400

Count Occurrences

Count how many times pattern p occurs in text s, overlaps included.

Input

Two lines: s, then p.

Output

A count.

Sample 1

Input
aaaa
aa
Output
3

Sample 2

Input
abababa
aba
Output
3
solution.py
Output appears here
Count Occurrences · Python Arena problem · LearnPy Hub