Search
⌘K

Leetcode 1624. Largest Substring Between Two Equal Characters

Given a string s, compute the maximum number of characters strictly between any two equal characters (i.e., maximize j - i - 1 for s[i] == s[j]); return -1 if no character repeats. This is essentially finding the farthest repeated pair in the string (n ≤ 300, lowercase letters).


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.