You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and without any intervening characters.
For example, given:
s: "barfoothefoobarman"
words: ["foo", "bar"]
You should return the indices: [0,9].
(order does not matter).
The Idea: The following is a brute force procedure. First I conclude the size of the complete substring I should expect. Call is cmpl_s. Since all the words are the same length, and I know the amount - I can determine this. Then iterating through s, I take each cmpl_s and split it into equal size chunks. Finally, I confirm that all of these words exists within the word set uniquely. If so, the index i within the first level for loop gets recorded into the returning vector.