Ezvor

1858. Longest Word With All Prefixes

MediumArray Preparing judge… LeetCode
ArrayStringDepth-First SearchTrie

Hints

Hint 1
Add all the words to a trie.
Hint 2
Check the longest path where all the nodes are words.