Tap here to switch tabs
Problem
Submissions

Problem: Largest Substring Between Two Equal Characters

med
30 min
Try to solve the Largest Substring Between Two Equal Characters problem.

Statement

Given a string s, return the length of the longest substring strictly between two identical characters, excluding the two characters themselves. If no two identical characters exist in s, return −1-1.

Constraints:

  • 1≤1 \leq s.length ≤300\leq 300

  • s consists only of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Largest Substring Between Two Equal Characters

med
30 min
Try to solve the Largest Substring Between Two Equal Characters problem.

Statement

Given a string s, return the length of the longest substring strictly between two identical characters, excluding the two characters themselves. If no two identical characters exist in s, return −1-1.

Constraints:

  • 1≤1 \leq s.length ≤300\leq 300

  • s consists only of lowercase English letters.