Substring search
Problem
How many times does it occur?
Input
You are given two lines. The length of each line does not exceed 255 characters.
Imprint
Count and print the number of times the first string occurs as a substring of the second.
Examples
# |
Input |
Output |
1 |
abab
abababcab
|
2 |
Explanation: substring abab occurs twice in the second line, starting from the 1st and 3rd characters.