private boolean sudoku(char[][] board, int pos) {
        int n = board.length;
        if(pos == n*n)
            return true;
        int x = pos/n;
        int y = pos%n;
        if(board[x][y]  == '.'){
            for(char c= '1'; c <= '9'; c++){
                board[x][y] = c;
                if(isValidSudoku(board,x,y) && sudoku(board,pos+1))
                    return true;
                board[x][y] ='.';
            }
            return false;
        }else{
            return sudoku(board, pos+1);
        }
    }