1668. Maximum Repeating Substring

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1668

class Solution:
    def maxRepeating(self, sequence: str, word: str) -> int:
        for k in range(len(sequence) // len(word), -1, -1):
            if word * k in sequence:
                return k