Longest Word in Dictionary
Medium
Trie
Given words, print the longest word that can be built one letter at a time by other words in the list (every prefix must also be a word). Break ties by the lexicographically smallest word.
Constraints
1 <= n <= 1000 1 <= len(word) <= 30
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.