Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
compressed solution in Clear category for Compress List by Stensen
def compress(l):
if not l: return []
r=[l[0]]
for i in l[1:]:
if i != r[-1]: r.append(i)
return r
Sept. 24, 2020