diff options
Diffstat (limited to 'progs/a520.py')
-rw-r--r-- | progs/a520.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/progs/a520.py b/progs/a520.py new file mode 100644 index 0000000..6ec2c1f --- /dev/null +++ b/progs/a520.py @@ -0,0 +1,3 @@ +from itertools import groupby
+def encode_list(list1):
+ return [[len(list(group)), key] for key, group in groupby(list1)]
\ No newline at end of file |