Consecutive Characters
Given a string s
, the power of the string is the maximum length of a non-empty substring that contains only one unique character.
Return the power of the string.
Example 1:
Example 2:
Example 3:
Example 4:
Example 5:
Constraints:
1 <= s.length <= 500
s
contains only lowercase English letters.
Solutions
🧠 Cpp
Last updated