LeetCode --- 1668. Maximum Repeating Substring 解题报告

Posted 杨鑫newlfe

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LeetCode --- 1668. Maximum Repeating Substring 解题报告相关的知识,希望对你有一定的参考价值。

For a string sequence, a string word is k-repeating if word concatenated k times is a substring of sequence. The word\'s maximum k-repeating value is the highest value k where word is k-repeating in sequence. If word is not a substring of sequenceword\'s maximum k-repeating value is 0.

Given strings sequence and word, return the maximum k-repeating value of word in sequence.

Example 1:

Input: sequence = "ababc", word = "ab"
Output: 2
Explanation: "abab" is a substring in "ababc".

以上是关于LeetCode --- 1668. Maximum Repeating Substring 解题报告的主要内容,如果未能解决你的问题,请参考以下文章