首页 > 单词搜索
头像 菜到不能再菜的那种
发表于 2022-03-27 00:39:31
public class Solution { public boolean exist(String[] strs, String word) { char[][] board = new char[strs.length][strs[0].length()]; 展开全文
头像 程家斌
发表于 2025-07-05 22:19:12
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param board string字符串vector * @param word st 展开全文
头像 牛客207221769号
发表于 2022-04-14 15:15:16
dfs算法,走过的每一步置为0,防止再次走过,都走不通则回溯。 class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param board string 展开全文
头像 小菜鸡略略略
发表于 2022-03-16 13:29:42
java版来了 public boolean exist (String[] board, String word){ int rowSize = board.length; int colSize = board[0].length(); / 展开全文
头像 觉醒火龙果很想五点下课
发表于 2025-05-28 13:34:30
class Solution { public: vector<vector<int>> direction = {{0, -1},{-1, 0},{0, +1},{+1, 0} }; //左上右下 vector<vector<int>&g 展开全文
头像 靠近1
发表于 2024-07-12 02:30:41
class Solution { public: bool arr[101][101] = { 0 };//用来标记该位置是否查询过 int n,m; int dy[4]={1,-1,0,0}; int dx[4]={0,0,1,-1}; bool 展开全文
头像 fred-coder
发表于 2021-12-03 23:49:17
利用 dfs 进行搜索,避免重复访问加入辅助数组 vistited,注意在每次路径递归失败后,将辅助数组的值置回初始值。 # # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param board string字符串一维数组 # @param word 展开全文
头像 就要上岸了的伊登很强大
发表于 2025-09-23 13:26:16
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param board string字符串一维数组 展开全文
头像 Mr.galaxy
发表于 2023-01-15 22:21:09
#include <string> class Solution { public: bool exist(vector<string>& board, string word) { // write code here in 展开全文
头像 牛客768685351号
发表于 2022-03-17 19:21:31
class Solution { private: bool res = false; public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param board string字 展开全文

等你来战

查看全部