class Solution: def exist(self, board: List[List[str]], word: str) -> bool: # - sanity check n_row = len(board) if not n_row: return False n_col = len(board[0]) if not n_col: return False def dfs(row, col, i, seen): if i == len(word)-1: return True for dr,dc...
127. Word Ladder via java 2019-12-04 07:09 −A classic BFS problem, that is, we use a Queue to store temporary solution and record the size of the current Queue. For each node in this BFS tr... La_Campanella 0 293 <123>