Tap here to switch tabs
Problem
Submissions

Problem: Consecutive Characters

med
30 min
Try to solve the Consecutive Characters problem.

Statement

Given a string s, the power of the string is defined as the maximum length of a non empty substring that contains only one unique character.

Return the power of s.

Constraints:

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

  • s consists of only lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Consecutive Characters

med
30 min
Try to solve the Consecutive Characters problem.

Statement

Given a string s, the power of the string is defined as the maximum length of a non empty substring that contains only one unique character.

Return the power of s.

Constraints:

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

  • s consists of only lowercase English letters.