MCPcopy Create free account
hub / github.com/HuberTRoy/leetCode / exist

Method exist

DFS/WordSearch.py:193–204  ·  view source on GitHub ↗

:type board: List[List[str]] :type word: str :rtype: bool

(self, board, word)

Source from the content-addressed store, hash-verified

191class Solution(object):
192
193 def exist(self, board, word):
194 """
195 :type board: List[List[str]]
196 :type word: str
197 :rtype: bool
198 """
199 for i, d in enumerate(board):
200 for i2, d2 in enumerate(d):
201 if d2 == word[0]:
202 if self.search(board, i2, i, word):
203 return True
204 return False
205
206 def search(self, board, x, y, word):
207 """

Callers

nothing calls this directly

Calls 1

searchMethod · 0.95

Tested by

no test coverage detected