1668. Maximum Repeating Substring

Обновлено: 2024-03-12
1 мин
[]

Содержание

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