```python from typing import List trie = {} END = '$' class Solution: def find(self, board: List[List[int]], dictionary: List[int]) -> List[str]: for word in dictionary: node = trie for letter in word: node = node.setdefault(letter, {}) node[END] = word row, col = len(board), len(board[0]) visited = [[0 for _ in range(col)] for _ in range(row)] res = [] def dfs(i, j, t): if END in t: res.append(t[END]) del t[END] visited[i][j] = 1 points = [(i + dx, j + dy) for dx, dy in [(-1, 0), (1, 0), (0, -1), (0, 1), (-1, -1), (-1, 1), (1, -1), (1, 1)] if 0 <= i + dx < row and 0 <= j + dy < col] for dx, dy in points: if board[dx][dy] in t and not visited[dx][dy]: dfs(dx, dy, t[board[dx][dy]]) visited[i][j] = 0 for i in range(row): for j in range(col): if board[i][j] in trie: dfs(i, j, trie[board[i][j]]) return res board = [['A', 'B', 'C', 'D'], ['E', 'F', 'G', 'H'], ['I', 'J', 'K', 'L'], ['M', 'N', 'O', 'P']] word_dict = {"ABE", "ACF", "ACFH", "ACFHJ", "ADI", "ABCFH", "BCFH", "CFH"} sol = Solution() print(sol.find(board, word_dict)) ``` In this example, the code utilizes a Trie data structure to facilitate efficient word retrieval, alongside a Depth-First Search (DFS) method for navigating the board. The integration of Trie and DFS allows for enhanced performance when working with complex datasets in this problem.