MCPcopy Create free account
hub / github.com/chaharnishant11/CodeIn10DSA / exist

Method exist

Backtracking/Code/wordSearch.cpp:18–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16 }
17
18 bool exist(vector<vector<char>>& board,string word) {
19 int n=board.size();
20 if(n==0) return false;
21 int m=board[0].size();
22 if(word.size()==0) return false;
23 for(int i=0;i<n;i++){
24 for(int j=0;j<m;j++){
25 if(word[0]==board[i][j]){
26 if(helper(board,word,i,j,n,m,0))return true;
27 }
28 }
29 }
30 return false;
31 }
32};

Callers

nothing calls this directly

Calls 1

helperFunction · 0.70

Tested by

no test coverage detected