Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Simple loop solution in Clear category for Group Equal consecutive by quarkov
def group_equal(els):
if not els:
return []
chunk, result = [els[0]], []
for el in els[1:]:
if el in chunk:
chunk.append(el)
else:
result.append(chunk)
chunk = [el]
return result + [chunk]
Feb. 26, 2019
Comments: