C++ solution||easy understanding||recursion||dfs
\nclass Solution {\npublic:\n    bool search(int i,int j,int n,int m,vector<vector<char>>& board, string word,int k){\n        if(k==word.size()) return true;\n
```\nclass Solution {\npublic:\n    bool search(int i,int j,int n,int m,vector<vector<char>>& board, string word,int k){\n        if(k==word.size()) return true;\n        if(i<0||j<0||i==n||j==m||board[i][j]!=word[k]) return false;\n        char ch = board[i][j];\n        board[i][j]=\'#\';\n        bool opt1= search(i+1,j,n,m,board,word,k+1);\n        bool opt2= search(i,j+1,n,m,board,word,k+1);\n        bool opt3= search(i-1,j,n,m,board,word,k+1);\n        bool opt4= search(i,j-1,n,m,board,word,k+1);\n        board[i][j]=ch;\n        return opt1||opt2||opt3||opt4;\n    }\n    bool exist(vector<vector<char>>& board, string word) {\n        int n =board.size();\n        int m = board[0].size();\n        for(int i =0;i<n;i++){\n            for(int j = 0;j<m;j++){\n                if(search(i,j,n,m,board,word,0)) return true;\n            }\n        }\n        return false;\n        \n    }\n};\n```
['Depth-First Search', 'Recursion', 'C']