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