Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Long Repeat by twilyght
import itertools
def long_repeat(line: str) -> int:
"""
length the longest substring that consists of the same char
"""
return max(len(list(g)) for _, g in itertools.groupby(line)) if line else 0
May 8, 2020
Comments: