diff --git a/C++/Word_Search.cpp b/C++/Word_Search.cpp new file mode 100644 index 00000000..6047e4ae --- /dev/null +++ b/C++/Word_Search.cpp @@ -0,0 +1,30 @@ +class Solution { +public: + + bool dfs(vector>& board,int i,int j,int count,string word) + { + if(count==word.length()) + return true; + if(i<0||i>=board.size()||j<0||j>=board[i].size()||board[i][j]!=word[count]) + return false; + + char temp = board[i][j]; + board[i][j]=' '; + bool found = dfs(board,i+1,j,count+1,word)||dfs(board,i,j+1,count+1,word)||dfs(board,i-1,j,count+1,word)||dfs(board,i,j-1,count+1,word); + board[i][j]=temp; + return found; + } + + bool exist(vector>& board, string word) { + + for(int i=0;i | Turkey | python | [Github](https://github.com/MercerFrey) | | [Saurav Prateek](https://github.com/SauravP97)
| India | Java | [Github](https://github.com/SauravP97)
[Codechef](https://www.codechef.com/users/srvptk)
[Codeforces](https://codeforces.com/profile/srvptk97)
[Leetcode](https://leetcode.com/srvptk97) | | [Anushka Verma](https://github.com/verma-anushka)
| India | C++ | [Portfolio](https://verma-anushka.github.io/anushkaverma/)
[LeetCode](https://leetcode.com/anushka_verma/) | -| [James H](https://github.com/HoangJames)
| United Kingdom | C++ | [Github](https://github.com/HoangJames) | +| [James H](https://github.com/HoangJames)
| United Kingdom | C++ | [Github](https://github.com/HoangJames) +| [Aviral Tandon](https://github.com/aviraltandon21)
| India | C++ | [Linkedin](https://www.linkedin.com/in/aviral-tandon-b852891a1/)
[Portfolio](https://aviraltandon.com/) | | | [Franchis N. Saikia](https://github.com/Francode007)
| India | C++ | [Github](https://github.com/Francode007) | | [Yarncha](https://github.com/yarncha)
| South Korea | C++ | [LeetCode](https://leetcode.com/yamcha/) | | [Gamez0](https://github.com/Gamez0)
| South Korea | Python | [LeetCode](https://leetcode.com/Gamez0/) |