Pure StorageOA #13
Find Repetitions
估计简单可在线判题
考点(AI 标注)字符串
Given a pattern string short_s and a text long_s, find the maximum number of times short_s repeats consecutively in long_s. No other characters may appear between occurrences. If either string is empty, the answer is 0.
输入格式
Two lines of uppercase English letters: the first line is short_s and the second is long_s, with lengths 0..9 and 0..999999 respectively. An empty string is given as an empty line.
输出格式
Output the maximum number of consecutive repetitions.
样例 1
输入:
AB
ABBAC
输出:
1
样例 2
输入:
AB
ABCABCABAB
输出:
2
样例 3
输入:
ABC
输出:
0