Ritual interview question

Given a list of substrings and an input string, determine whether the input string can be composed using the substrings. e.g. Given "a", "man", "break", determine if "amanabreak" can be decomposed. Answer: Yes: "a" "man" "a" "break".

Interview Answer

Anonymous

13 Feb 2018

Use the Trie data structure.