I try to understand the questions.
says, input is "foobarfoothefoobarman" ["foo","bar"]
why the input is [0,3,12] instead of [0,6,12]
Hello Hirakawa, It is because the order of words is not important: Starting at index 0, we have foobar Starting at index 3, we have barfoo Starting at index 6, we have just foo (not followed by bar) Starting at index 12 we have foobar again. Hence the output is [0,3,12] and not [0,6,12]. I hope it helps.