LookSay/ansemenov | LookSay/abatueva | ||||
---|---|---|---|---|---|
f | 1 | from itertools import groupby | f | 1 | from itertools import groupby |
2 | 2 | ||||
3 | def LookSay(): | 3 | def LookSay(): | ||
n | 4 | res = '1' | n | 4 | num = '1' |
5 | yield int(res) | 5 | yield int(num) | ||
6 | while True: | 6 | while True: | ||
t | 7 | res = ''.join((str(len(list(g))) + k for (k, g) in groupby(str(res)))) | t | 7 | num = ''.join((str(len(list(nums))) + n for (n, nums) in groupby(num))) |
8 | for k in res: | 8 | for ch in num: | ||
9 | yield int(k) | 9 | yield int(ch) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|