Solved WordSearch problem with DFS method