1956. Minimum Time For K Virus Variants to Spread
https://leetcode.com/problems/minimum-time-for-k-virus-variants-to-spread
Description
There are n
unique virus variants in an infinite 2D grid. You are given a 2D array points
, where points[i] = [xi, yi]
represents a virus originating at (xi, yi)
on day 0
. Note that it is possible for multiple virus variants to originate at the same point.
Every day, each cell infected with a virus variant will spread the virus to all neighboring points in the four cardinal directions (i.e. up, down, left, and right). If a cell has multiple variants, all the variants will spread without interfering with each other.
Given an integer k
, return the minimum integer number of days for any point to contain at least k
of the unique virus variants.
Example 1:
Example 2:
Example 3:
Constraints:
n == points.length
2 <= n <= 50
points[i].length == 2
1 <= xi, yi <= 109
2 <= k <= n
ac
Last updated