Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Using enumerate solution in Clear category for Compress List by erykcoapl
from typing import Iterable
def compress(items: list) -> Iterable:
return [v for i, v in enumerate(items) if not i or v != items[i-1]]
March 28, 2021
Comments: