Could anysome help explain to me what does "surrounded" mean?

  • 11

    for example:

    x x x x

    x o o x

    x x o x

    x o x x

    why the above three 'o' are surrounded regions? I mean, the 'o' in the third row has another 'o' neighbored to it,so why it is still surrounded region?

  • 2

    Surrounded regions shouldn't be on the border, which means that any 'O' on the border of the board are not flipped to 'X'. Any 'O' that is not on the border and it is not connected to an 'O' on the border will be flipped to 'X'.

Log in to reply

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