这道题坑太多了,思路虽然简单,但是想考虑得完整太难了。 class Solution { public: bool hasPath(char* matrix, int rows, int cols, char* str) { if (matrix == nullptr || str == nullptr || rows < 1 || cols < 1) return false; bool* markmatrix = new bool[rows * cols](); for (int i = 0...