Jhinww SeeSaw 9715
Балтаев Глеб Иркинович 341 SeeSaw 9443
f1from collections import dequef1from collections import deque
22
3def seesaw(sequence):3def seesaw(sequence):
n4    evens = deque()n4    even_queue = deque()
5    odds = deque()5    odd_queue = deque()
6    for number in sequence:6    for item in sequence:
7        if number % 2 == 0:7        if item % 2 == 0:
8            evens.append(number)8            even_queue.append(item)
9        else:9        else:
t10            odds.append(number)t10            odd_queue.append(item)
11    while evens or odds:11    while even_queue or odd_queue:
12        if evens:12        if even_queue:
13            yield evens.popleft()13            yield even_queue.popleft()
14        if odds:14        if odd_queue:
15            yield odds.popleft()15            yield odd_queue.popleft()
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op