summaryrefslogtreecommitdiff
path: root/progs/a297.py
blob: 8fc6032ae50170e4ec6de1ac1340fdd2154656b4 (plain)
1
2
3
4
from itertools import groupby 
def extract_elements(numbers, n):
    result = [i for i, j in groupby(numbers) if len(list(j)) == n] 
    return result