Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Compress List by brispol19
compress = lambda items: [items[0]] + [items[x] for x in range(1, len(items)) if items[x] != items[x-1]] if len(items) >= 1 else []
Feb. 11, 2020