LookSay/WhiteFox585 | LookSay/Mik | ||||
---|---|---|---|---|---|
n | 1 | import itertools | n | 1 | from itertools import groupby |
2 | 2 | ||||
3 | def LookSay(): | 3 | def LookSay(): | ||
n | 4 | x = '1' | n | 4 | next_num = '1' |
5 | yield int(x) | 5 | yield int(next_num) | ||
6 | while True: | 6 | while True: | ||
t | 7 | x = ''.join((str(len(list(g))) + k for (k, g) in itertools.groupby(x))) | t | 7 | next_num = ''.join((str(len(list(g))) + k for (k, g) in groupby(next_num))) |
8 | for i in range(len(x)): | 8 | for i in range(len(next_num)): | ||
9 | yield int(x[i]) | 9 | yield int(next_num[i]) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|