[[0,1,0,0,0,0,0,1],[0,1,0,1,0,0,0,1],[0,0,0,0,0,0,0,1]]
I am curios how that 16 is expected
I guess the expected result was like this
left most: 5walls used. middle influnce 4 cells, right influnce 3 cells. middle next: 9 walls used. right influnce 3 more cells, 2walls used to control the virus.
total influnced 10 cells, 16 walls used
My solution is like this
right most: 3 walls used. 8 cells influnced. as a result left two regions merged. 10 walls used
total influnced 8 cells, 13 walls used