public void nextQueens(String[] board,int row,int n){
        if(row >= n){
            list.add(copy(board));
            return ;
        }
        char[] crow = board[row].toCharArray();
        for(int col=0; col< n;col++){
            if(ok(board,row,col,n)){
                crow[col] ='Q';
                board[row] = new String(crow);
                nextQueens(board,row+1,n);
                crow[col] ='.';
            }
        }
        board[row] = new String(crow);
    }