Search
⌘K

Leetcode 2982. Find Longest Special Substring That Occurs Thrice II

Find the maximum length L of a "special" substring (a contiguous run of a single repeated character) that appears at least three times in s (occurrences may overlap), or return -1 if none. With |s| up to 5e5, the solution should be near-linear or n log n in complexity.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.