Longest Word Built One Letter at a Time
Medium
Trie (Advanced)
Print the longest word in the list such that every prefix of it is also in the list. If several, print the lexicographically smallest.
Constraints
1 <= n <= 1000
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.