public void solve(char[][] board) {
        int m = board.length;
        if(m==0)
            return;
        int n = board[0].length;
        for(int i = 0;i<m;i++){
            change(board, i, 0);
            change(board, i, n-1);
        }
        for(int i = 1;i<n-1;i++){
            change(board, 0, i);
            change(board, m-1, i);
        }
        for(int i = 0;i<m;i++){
            for(int j=0;j<n;j++){
                if (board[i][j] == 'Y')
                    board[i][j] = 'O';
                else if (board[i][j] == 'O')
                    board[i][j] = 'X';
            }
        }
    }