Algorithm · Anthropic · Hard
You are given a grid with R rows and C columns. Every cell holds a value of 0 (healthy) or 1 (infected). The infection evolves in discrete time steps (minutes). At each minute, a healthy cell changes to infected if the count of its already-infected orthogonal neighbors (up, down, left, right) is at least K. All updates happen simultaneously based on the state at the beginning of the minute. The process stops when a full minute passes with no new infections. Your task is to…
Checking your access…