/**
* @param {character[][]} board
* @return {void} Do not return anything, modify board in-place instead.
*/varsolve=function(board){var m = board.length;if(m ===0)returnvoid0;var n = board[0].length;vardfs=function(x, y){if(x<0|| y<0|| x>=m || y>=n || board[x][y]!=='O')returnvoid0; board[x][y]='A';dfs(x +1, y);dfs(x -1, y);dfs(x, y +1);dfs(x, y -1);}for(let i =0; i < m; i++){dfs(i,0);dfs(i, n -1);}for(let i =1; i < n -1; i++){dfs(0, i);dfs(m -1, i);}for(let i =0; i < m; i++){for(let k =0; k < n; k++){if(board[i][k]=='A') board[i][k]='O';elseif(board[i][k]=='O') board[i][k]='X';}}returnvoid0;};