diff options
Diffstat (limited to 'progs/a297.py')
-rw-r--r-- | progs/a297.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/progs/a297.py b/progs/a297.py new file mode 100644 index 0000000..8fc6032 --- /dev/null +++ b/progs/a297.py @@ -0,0 +1,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
\ No newline at end of file |