Microorganisms eating neighbours: the largest survivor
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 answer yet. Write the first one; the best answer gets endorsed.
