Find first index of continuous substrings with all the words in a list appear exactl once each