简单的dfs,做一下简单的判断即可,记得引用传参 class Solution { public: vector<vector<bool>> search_map_; int row_; int col_; bool is_success_ = false;// void DFS(vector<vector<char> >& matrix,int x,int y,int cur,const string& word){ if(is_success_)return; ...