For each word, run Word Search I (DFS from every cell).
With words and board of size , each word search takes where is word length. Total: .
Many words share common prefixes. Can you search for multiple words simultaneously?
Why brute force fails
For each word, run Word Search I (DFS from every cell).
With words and board of size , each word search takes where is word length. Total: .
Many words share common prefixes. Can you search for multiple words simultaneously?