Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
itertools.groupby() solution in Clear category for Sum Consecutives by Leonix
import itertools
def sum_consecutives(a):
return [sum(arr) for _, arr in itertools.groupby(a)]
July 8, 2019