Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Basic loop solution in Clear category for Group Equal consecutive by Phil15
def group_equal(elements):
L = [elements[:1]] if elements else []
for elem in elements[1:]:
if elem == L[-1][-1]:
L[-1].append(elem)
else:
L.append([elem])
return L
Oct. 29, 2018
Comments: