Given a string s, a substring is called special if it is made up of only one repeated character.
Return the maximum possible length of a special substring that appears in s at least three times. If no special substring occurs at least three times, return -1.
Note: Occurrences are counted by substring positions in
s, and they may overlap.
Constraints:
s.length
s consists of only lowercase English letters.
Given a string s, a substring is called special if it is made up of only one repeated character.
Return the maximum possible length of a special substring that appears in s at least three times. If no special substring occurs at least three times, return -1.
Note: Occurrences are counted by substring positions in
s, and they may overlap.
Constraints:
s.length
s consists of only lowercase English letters.