public void solve(char[][] board) {
        if (board == null || board.length == 0 || board[0].length == 0) return;
        for (int i = 0; i < board.length; ++i) {
            fill(board, i, 0);
            fill(board, i, board[0].length - 1);
        }
        for (int j = 0; j < board[0].length; ++j) {
            fill(board, 0, j);
            fill(board, board.length - 1, j);
        }
        for (int i = 0; i < board.length; ++i) {
            for (int j = 0; j < board[0].length; ++j) {
                if (board[i][j] == 'O') board[i][j] = 'X';
                else if (board[i][j] == '#') board[i][j] = 'O';
            }
        }
    }