Search
⌘K

Leetcode 2730. Find the Longest Semi-Repetitive Substring

Given a digit string, return the length of the longest contiguous substring that contains at most one adjacent equal pair (i.e., no more than one index i with s[i] == s[i+1]). This is essentially a sliding-window/two-pointer problem tracking the count of adjacent duplicate pairs.


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.