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