2009. Longest Word With All Prefixes

Medium
Array
String
Depth-First Search
Trie

Description

Hints

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

Statistics

Acceptance
72.0%
Submissions
20,027
Accepted
14,429