Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
1-liner: itertools.compress solution in Creative category for Compress List by Stensen
import itertools
compress = lambda l: itertools.compress(l,l[:1]+[l[i-1]!=l[i] for i in range(1, len(l))])
Sept. 24, 2020
Comments: