public boolean exist(char[][] board, String word) {
        if (board == null || board.length == 0 || word == null)
            return false;

        this.board = board;
        this.word = word;



        for (int i=0; i<board.length; i++) {
            for (int j=0; j<board[0].length; j++) {
                    boolean[][] visited = new boolean[board.length][board[0].length];
                    for (boolean[] row : visited)
                        Arrays.fill(row, false);
                    if (DFS(i, j, 0, visited))
                        return true;
            }
        }


        return false;
    }