Find the minimum walls needed to contain a spreading infection in a grid.
Unlock detailed company stats for this questionUpgrade
Given a 2D grid of infected regions (1) and uninfected areas (0), infected cells spread to adjacent cells every turn. You can build quarantine walls to isolate one infected region per turn. Determine the minimum number of wall segments needed to permanently contain the spread, greedily quarantining the region that threatens the largest number of uninfected cells at each step. This was a story-based variant of LeetCode 749 (Contain Virus).
Community answers
No answers contributed by the community yet.
Related questions
Find the minimum steps to reach the destination in a grid with jumps.Find the minimum initial power needed to reach the bottom-right cell of a grid.Find the minimum number of delivery partners needed to serve all houses in a grid.Related courses

Course

Course
Course
