Problem. Given an m × n grid of letters and a list of words, return all words that can be formed by a path of horizontally or vertically adjacent cells, using each cell at most once per word.
board = m o d e words = ["model", "mode", "map", "dole", "rest", "talk"]
a l s t
p e r k → ["dole", "map", "mode"]
Lesson 8.8 searched for one word by backtracking from every cell. With W words you could repeat it W times, but words share beginnings ("mode" and "model" start the same way): the board paths that spell "mod" get explored once per word. A trie lets one backtracking pass follow all words at once.
ML context. "Find which of many patterns occur" is the job of keyword and blocklist filters over training data and model outputs: PII markers, banned phrases, test-set leakage strings. In text (a 1-D grid), walking a trie of all patterns from each position finds every occurrence in one pass instead of one pass per pattern (Change D).