Search
⌘K

Leetcode 648. Replace Words

Given a dictionary of root words and a sentence, replace each word by the shortest root that is a prefix of it (if any) and return the transformed sentence. Efficient solutions perform prefix lookups (e.g., using a trie) to handle large words and many dictionary roots.

Asked at:

Uber


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Early August, 2025

Uber

Mid-level

Comments

Your account is free and you can post anonymously if you choose.