Algorithm · OpenAI · Hard
You are given a rectangular grid of cells and two integers: days, the number of simulation steps, and recovery_time, the amount of time an infected cell remains contagious before it recovers. Each cell is one of five characters: '.' — empty 'S' — susceptible 'I' — infected 'M' — immune 'R' — recovered During each simulated day, infection first spreads based on the cell states at the beginning of that day. A susceptible cell becomes infected if it shares an edge with at least…
Checking your access…