You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and without any intervening characters.
For example, given:
S: "barfoothefoobarman"
L: ["foo", "bar"]
You should return the indices: [0,9].
(order does not matter).
{优快云:CODE:633051}

本文介绍了一个字符串匹配的问题:给定一个字符串S和一个单词列表L,所有单词长度相同。任务是找出S中所有由L中每个单词恰好组成一次且中间没有插入其他字符的子串起始索引。
300

被折叠的 条评论
为什么被折叠?



