Меркушев Александр, группа 528 LookSay 9583 | Галустов Артемий Львович, 527 LookSay 9370 | ||||
---|---|---|---|---|---|
f | 1 | from itertools import groupby | f | 1 | from itertools import groupby |
2 | 2 | ||||
3 | def LookSay(): | 3 | def LookSay(): | ||
n | 4 | cur = '1' | n | 4 | i = '1' |
5 | while True: | 5 | while True: | ||
t | 6 | for didit in cur: | t | 6 | for el in i: |
7 | yield int(didit) | 7 | yield int(el) | ||
8 | cur = ''.join([str(len(list(g))) + k for k, g in groupby(cur)]) | 8 | i = ''.join((str(len(list(s))) + l for l, s in groupby(i))) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|