1446. Consecutive Characters
On This Page
class Solution:
def maxPower(self, s: str) -> int:
res = t = 1
for a, b in pairwise(s):
if a == b:
t += 1
res = max(res, t)
else:
t = 1
return res