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
73.1%
Submissions
22,406
Accepted
16,385