I have the following task:
A word "Superhighway" is given. Check if such word can be composed of entries in the array: [ab, bc, Super, h, igh, way] - yes; [ab, bc, Super, way] - no;
My suggestion is to build Trie from the array and based on the Trie conclude can the target word be derived or not.
Also, I've seen that Dynamic Programming is applicable to similar problems.
Could you please explain the best solution for the task?