Nov-13-2019, 03:15 PM
I thought that every human have to "infect" by zombies because the result is a matrix of all 1
Input: [[0, 1, 1, 0, 1], [0, 1, 0, 1, 0], [0, 0, 0, 0, 1], [0, 1, 0, 0, 0]] Output: 2 Why? At the end of the 1st hour, the status of the grid: [[1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [0, 1, 0, 1, 1], [1, 1, 1, 0, 1]] At the end of the 2nd hour, the status of the grid: [[1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1]]