public class Solution { public int[][] visit; //全局定义visit矩阵,拜访过的节点为1 public boolean hasPath(char[] matrix, int rows, int cols, char[] str) { visit = new int[rows][cols];//初始化拜访矩阵 char[][] array = new char[rows][cols]; for (int i = 0; i < rows ; i++) {//这部分非必要,转化后好理解 for(int j = 0; j < cols; j+...