Back to Question

Find the Longest Word in Dictionary through Deleting

Question Explain

Given a string $s$ and a dictionary of strings $d$, find the longest string in $d$ that can be formed by deleting some characters of $s$. If there are multiple long strings, return the lexicographically smallest one.

Start Trying This Question Simulation

Click "Start Speaking" and answer the question naturally.