Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Compress List by tokiojapan55
from typing import Iterable
def compress(items: list) -> Iterable:
return [a for a,b in zip(items, items[1:]+[-1]) if a!=b]
June 22, 2020