VFlash: Fast, Accurate Visual Planning via Flash Primitive Decoding
u_Unrolled
DSA for AI/ML · Module 13: Tries and strings

Lesson 13.4 of 6 in this module Unrolled Pro

Word Search II

Find every word from a list that can be traced on a letter grid through adjacent cells without reusing a cell. From running lesson 8.8's single-word backtracking once per word (W searches over the whole board), to one backtracking pass that walks a trie of all the words at the same time, abandoning a path the moment no word continues it, and pruning found words out of the trie so they're never searched again. Then a single word, huge word lists, cells that may be reused, and scanning text for many keywords at once to filter training data.

about 10 min 3 Python examples 2 quick checks

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.

text
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).


1. Step 1: Clarify

That's the preview. Modules 00–01 are free; this lesson is part of Unrolled Pro.
Staff AI & Pro Tier Lesson

Unlock "Word Search II"

The foundations are free forever. Unrolled Pro unlocks the complete lesson, production architectures, and 55 battle-tested ML system design case studies.

Everything included with Pro:
All 234+ Deep-Dive Lessons across transformer internals, inference, RAG & agents
55 Staff-Level ML & System Design Case Studies with mathematical capacity estimates
AI Engineer Sheet & Exercises with worked solutions, self-checks, and code
100 Landmark Research Papers guided walkthroughs & progress tracking
14-Day Money-Back Guarantee — 100% full refund if you aren't satisfied
View Plans & Unlock All Lessons

From ₹167/mo (~$2/mo) · Cancel anytime · Instant activation

100% Risk-Free: 14-day no-questions-asked money-back guarantee