class Solution { public: bool(vector<vector<char> >& board, string word){ int rows = board.size(); int cols = board[0].size(); for(int i = 0; i < rows; i++){ for(int j = 0; j < cols; j++){ if(isFound(board, word, 0, i, j)) returntrue; } } returnfalse; }
boolisFound(vector<vector<char> > &board, string word, int len, int i, int j){ if(i < 0 || i >= board.size() || j < 0 || j >= board[0].size() || board[i][j] == '
近期评论