Using a trie could definitely pass many cases, but how to pass one case. The dictionary only contains one word like "aaaaa........" n a and the board contains the array with only n 'a' too. In this case, I think the DFS + Trie method's time complexity should be exponential. Could someone help me figure out the time complexity of the DFS + Trie method?
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.