← Questions
Microorganisms eating neighbours: the largest survivor
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Microorganisms stand in a row. Each one has a family (a letter) and a size (a positive integer). A microorganism can eat the neighbour directly to its left or right when that neighbour is from a different family and strictly smaller. The simulation runs in rounds, scanning the row from left to right, and stops when no one can eat anyone.
Simulate it and return the size of the largest microorganism left at the end. Be precise about how one round proceeds and about what happens to sizes when one eats another, and say how fast your simulation runs.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
