Great Speedy!
I think using an assignment expression will speed things up a bit.
More
At first I thought this code would make a calculation mistake, but this code is correct.
More
while len(ugly_list) < n*5:
this "max count" is correct.
Isn't the idea of using "pop(0)" instead of "deque.popleft()" a bad idea?
More
Good Solution!
I think it will be faster this way.
power = init(network, set(plants), all_nodes)
More
Oh. "text.split(' ')" and "text.split()" have different operations. it was helpful
More