summaryrefslogtreecommitdiff
path: root/progs/a520.py
blob: 6ec2c1f1519c39b3764973a9569acf3365dd8d9d (plain)
1
2
3
from itertools import groupby
def encode_list(list1):
    return [[len(list(group)), key] for key, group in groupby(list1)]