I don't see how the expected answer for the following example is 38. I got 40. Any explanations?


  • 0
    S

    [[0,1,0,1,1,1,1,1,1,0],
    [0,0,0,1,0,0,0,0,0,0],
    [0,0,1,1,1,0,0,0,1,0],
    [0,0,0,1,1,0,0,1,1,0],
    [0,1,0,0,1,0,1,1,0,1],
    [0,0,0,1,0,1,0,1,1,1],
    [0,1,0,0,1,0,0,1,1,0],
    [0,1,0,1,0,0,0,1,1,0],
    [0,1,1,0,0,1,1,0,0,1],
    [1,0,1,1,0,1,0,1,0,1]]


  • 0
    S

    Never mind; I read the requirements wrong. Notice that It depends on region to be quarantined depends not on number of walls, but the number of cells that would be affected.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.