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