Python DFS solution
class Solution:\n        # @param board, a list of lists of 1 length string\n        # @param word, a string\n        # @return a boolean\n        # 3:42\n     
    class Solution:\n        # @param board, a list of lists of 1 length string\n        # @param word, a string\n        # @return a boolean\n        # 3:42\n        def exist(self, board, word):\n            visited = {}\n    \n            for i in range(len(board)):\n                for j in range(len(board[0])):\n                    if self.getWords(board, word, i, j, visited):\n                        return True\n            \n            return False\n    \n        def getWords(self, board, word, i, j, visited, pos = 0):\n            if pos == len(word):\n                return True\n    \n            if i < 0 or i == len(board) or j < 0 or j == len(board[0]) or visited.get((i, j)) or word[pos] != board[i][j]:\n                return False\n    \n            visited[(i, j)] = True\n            res = self.getWords(board, word, i, j + 1, visited, pos + 1) \\\n                    or self.getWords(board, word, i, j - 1, visited, pos + 1) \\\n                    or self.getWords(board, word, i + 1, j, visited, pos + 1) \\\n                    or self.getWords(board, word, i - 1, j, visited, pos + 1)\n            visited[(i, j)] = False\n    \n            return res
['Depth-First Search', 'Python']