Assuming you've read the problem:
I coded up an answer, then ran test cases, only to find:
String s: "barfoofoobarthefoobarman"
String words: ["bar","foo","the"]
String s starting at index 0 is a concatenation of
"bar" and "foo" in
String words so why is index 0 not part of the correct (Expected) answer?
So my algorithm didn't address the question, meaning I didn't understand the problem!
Simply, my algorithm is,
if current (first) substring of length 3 is inside
check if the next substring of length 3 is also in
save current (first) index of substring