leetle

Daily challenge for 2026-11-20

689. Longest Sequence of Duplicate Substrings

Given a string s and an integer k, find the length of the longest sequence of non-overlapping occurrences of the same substring of length k. If no such substring exists (i.e. the string is too short), return 0. Example:
Input: {"s": "abacabadabac", "k": 4}
Output: 2

Constraints: The string has 0 to 2000 lowercase ASCII letters; 1 <= k <= 2000. Return the maximum number of occurrences, not their combined character length.

Run this challenge interactively in Python or JavaScript when the app loads.