Free written solutionLargest Substring Between Two Equal Characters (LeetCode 1624): Solution and Explanation
Find the longest stretch of characters that sits strictly between two equal letters of a lowercase string. Return -1 when no letter repeats.
Read the intuition, approach, code and complexity →