I am attempting to write a function that will take a string array of words [I know that all the letters that compose the words are within the phrase] and a Phrase[all spaces are removed] and decide which words might be in the phrase together.
Perhaps an example will illustrate my point:
Phrase: afox [a fox]
Words: a ax of ox fox oaf fax
Example tests: aax [fails because only one a exists]
aof [Fails because the test phrase is too short]
Any ideas? I've been trying to figure out a way [not even the best way, just a way] to do it without any success. I even cut out little pieces of paper with the words on them.
It seems like it would be simple in theory, but there just so many unknowns.