Replace Words with Roots
Medium
Trie (Advanced)
Given a dictionary of roots and a sentence, replace each word by the shortest root that is its prefix; keep the word if no root fits.
Constraints
1 <= d <= 1000
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.