Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
re solution in Uncategorized category for Long Repeat by lxf42
import re
def long_repeat(line: str) -> int:
"""
length the longest substring that consists of the same char
"""
return max(len(x[0]) for x in re.findall(r'((.)\2*)', line)) if line else 0
Feb. 27, 2022