Given a set of words: S = {“the”, “to”, “presentation”}

And a text T = “textmayrefer**totherepresentatio**nofwrittenlanguage”

Find the index of matching in text T from *all* words of S (one of permutations of S). It guarantees that the substring occurs exactly once in text.

Any idea how to solve this problem? (without bruteforce :()

try Finite State Automata…not sure if it will work…!!!

can u post a link to the problem page?