LookSay/pold | LookSay/dfrant | ||||
---|---|---|---|---|---|
n | 1 | import itertools | n | 1 | from itertools import groupby |
2 | 2 | ||||
3 | def LookSay(): | 3 | def LookSay(): | ||
n | 4 | number = '1' | n | 4 | st = '1' |
5 | while True: | 5 | while True: | ||
t | 6 | for i in number: | t | 6 | for s in st: |
7 | yield int(i) | 7 | yield int(s) | ||
8 | number = ''.join((str(len(list(j))) + i for (i, j) in itertools.groupby(number))) | 8 | st = ''.join((str(len(list(group))) + key for (key, group) in groupby(st))) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|