Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Single pass through input solution in Speedy category for Group Equal consecutive by StroamCR
def group_equal(items):
if not items: return []
result = []
a = [items[0]]
for elem in items[1:]:
if elem == a[0]:
a.append(elem)
else:
result.append(a)
a = [elem]
result.append(a)
return result
March 12, 2019