Available question text
Given a list of words, find the longest word such that every prefix of that word is also present in the list (break ties by lexicographical order). The core challenge is efficiently verifying all prefixes (using a hash set or trie) and selecting the longest/lexicographically smallest valid word.
Related questions
Continue with questions that share topics or the same question type.
- Find the Score of All Prefixes of an Array
Coding
- Longest Substring Of All Vowels in Order
Coding · Sliding Window · String
- Longest Word in Dictionary
Coding
- Longest Word in Dictionary through Deleting
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1858. Longest Word With All Prefixes
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source