Uber Coding Interview Question - Word Search - Leetcode 79

preview_player
Показать описание
FAANG Coding Interviews / Data Structures and Algorithms / Leetcode
Рекомендации по теме
Комментарии
Автор

Master Data Structures & Algorithms For FREE at AlgoMap.io!

GregHogg
Автор

This can be solved in O(nm) since once you find the first letter it's trivial to check neighbours in order to complete the word

sebaitor
Автор

Greg, can you please link your code for every video? It’s easier that way!

PSBhat-xdgp
Автор

overall a fun graph problem, I really like lattices.

Aryeh-o
Автор

The big deal is finding the first A
you can use cache for that
the rest of the word is 9*len(word) steps worst case.

Maybe you can use caching or mark-off bad edges from the graph while you search, in case you end up backtracking and want to narrow the search space.

but I doubt it's effective!

Aryeh-o