public boolean exist(char[][] board, String word) {
        if (word==null)
            return true;
        int m = board.length;
        if(m==0)
            return false;
        int n = board[0].length;
        boolean[][] canCheck = new boolean[m][n];
        for(int i=0;i<m;i++)
            for(int j=0;j<n;j++)
                canCheck[i][j] = true;
        for(int i=0;i<m;i++)
            for(int j=0;j<n;j++){
                if(board[i][j] == word.charAt(0)){
                    canCheck[i][j] = false;
                    if (word.length()<=1)
                        return true;
                    if(checkExist(board, canCheck, i, j, word.substring(1)))
                        return true;
                    canCheck[i][j] = true;
                }
            }
        return false;
    }