Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
groupby solution in Clear category for Compress List by kkkkk
from typing import Iterable
from itertools import groupby
def compress(items: list) -> Iterable:
"""Return items after removing duplicates appearing in succession."""
return [group[0] for group in groupby(items)]
Feb. 1, 2020
Comments: