Андреева Елизавета, 522 LookSay 9484 | Дудаков Денис Вадимович ИИКБ_119 LookSay 10707 | ||||
---|---|---|---|---|---|
f | 1 | from itertools import groupby | f | 1 | from itertools import groupby |
2 | 2 | ||||
3 | def LookSay(): | 3 | def LookSay(): | ||
n | 4 | curr_val = '1' | n | 4 | term = '1' |
5 | yield int(curr_val) | 5 | yield int(term) | ||
6 | while True: | 6 | while True: | ||
t | 7 | curr_val = ''.join((str(len(list(g))) + k for k, g in groupby(curr_val))) | t | 7 | term = ''.join((str(len(list(group))) + k for k, group in groupby(term))) |
8 | for i in curr_val: | 8 | for t in term: | ||
9 | yield int(i) | 9 | yield int(t) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|