You are given an board consisting of characters 'X' and 'O'.
Capture all regions that are surrounded by 'X'.
A region is considered captured when every 'O' within it is replaced by 'X'. A region of 'O' cells is surrounded if it is completely enclosed by 'X' cells horizontally and vertically, such that no cell in the region connects to any boundary of board through horizontally or vertically adjacent 'O' cells.
Modify board in place.
Constraints:
m board.length
n board[i].length
m, n
board[i][j] is 'X' or 'O'.
You are given an board consisting of characters 'X' and 'O'.
Capture all regions that are surrounded by 'X'.
A region is considered captured when every 'O' within it is replaced by 'X'. A region of 'O' cells is surrounded if it is completely enclosed by 'X' cells horizontally and vertically, such that no cell in the region connects to any boundary of board through horizontally or vertically adjacent 'O' cells.
Modify board in place.
Constraints:
m board.length
n board[i].length
m, n
board[i][j] is 'X' or 'O'.