Write a program to count the number of occurrences of a substring in a string.
MediumProblem Statement
Write a program to count the number of occurrences of a substring in a string.
Sample Input
String: "abababab", Substring: "ab"
Sample Output
4
Limits
Time: 2s · Memory: 256 MB