Reconstruct Sentence from Dictionary

Given a string s with no spaces and a dictionary of words, insert spaces into s so that it becomes a sequence of dictionary words.

  • Return any valid reconstructed sentence, with words separated ...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: