Reported interview periodNot available
Segment text with a word list
Given a text and a small dictionary, decide whether the whole text can be written as a sequence of dictionary words, reusing a word as often as needed.
Practice focusRequirements - Line 1 is the text; line 2 is how many dictionary words follow, one per line. - Some inputs carry the two characters backslash and n instead of real line breaks; treat both forms as line separators before parsing. - Every character of the text must be covered in order by whole dictionary words; nothing may be skipped or reordered. - Words may be reused, and a word may be shorter than the remaining text but must match exactly at the current position. - Return true or false in lowercase, with no other text.…