
Sum Consecutives
You are given a list that contains solely integers (positive and negative). Your job is to sum only the numbers that are identical and consecutive.
Input: a list.
Output: an iterable.
Example:
sum_consecutives([1, 1, 1, 1]) == [4] sum_consecutives([1, 1, 2, 2]) == [2, 4]