(r, c, node, word)
| 33 | res, visit = set(), set() |
| 34 | |
| 35 | def dfs(r, c, node, word): |
| 36 | if ( |
| 37 | r not in range(ROWS) |
| 38 | or c not in range(COLS) |
| 39 | or board[r][c] not in node.children |
| 40 | or node.children[board[r][c]].refs < 1 |
| 41 | or (r, c) in visit |
| 42 | ): |
| 43 | return |
| 44 | |
| 45 | visit.add((r, c)) |
| 46 | node = node.children[board[r][c]] |
| 47 | word += board[r][c] |
| 48 | if node.isWord: |
| 49 | node.isWord = False |
| 50 | res.add(word) |
| 51 | root.removeWord(word) |
| 52 | |
| 53 | dfs(r + 1, c, node, word) |
| 54 | dfs(r - 1, c, node, word) |
| 55 | dfs(r, c + 1, node, word) |
| 56 | dfs(r, c - 1, node, word) |
| 57 | visit.remove((r, c)) |
| 58 | |
| 59 | for r in range(ROWS): |
| 60 | for c in range(COLS): |
nothing calls this directly
no test coverage detected