First solution in Clear category for Long Repeat by
from itertools import groupby
"""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