Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Sum Consecutives by Sillte
from itertools import groupby
def sum_consecutives(a):
return [key * len(list(value)) for key, value in groupby(a)]
Aug. 18, 2019