SSnowflake·DSASDE-2Online Assessment
Word Search II (Trie + DFS)
Problem
Given a board of letters and a word list, return all words that can be formed by adjacent cells.
Example
find all dictionary words present in the grid
Constraints
- Up to 10^4 words
Approach
Build a trie of words, DFS the board pruning by trie. Snowflake favors graph/trie problems.
added 6 days ago