08 Dec Aurora Saturday 14:30 Python Practice 22.12.03.
Question:
Given a string with length of n and a substring with length of m(0<m<=n<=1000), write program to search all occurrences of substring in string. Once the substring is found, the next substring should start from the character after the previous substring, such as there are maximum 3 ‘aa’ could be found in the ‘aaaaaa’
Input Specification:
Each line contains a string A and a substring B.
The input ends at #
Output Specification:
print the maximum occurrences of substring in string.
Sample Input:
abcde a3
aaaaaa aa
#
Sample Output:
0
3
Sorry, the comment form is closed at this time.