3648. Minimum Sensors to Cover Grid
You are given
n × mgrid and an integerk.A sensor placed on cell
(r, c)covers all cells whose Chebyshev distance from(r, c)is at mostk.The Chebyshev distance between two cells
(r1, c1)and(r2, c2)ismax(|r1 − r2|,|c1 − c2|).Your task is to return the minimum number of sensors required to cover every cell of the grid.
1 | class Solution { |