标签:io ar strong for sp div art c on
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).
题目:给定一个字符串S,一个字符串数组L,找出S中所有这样的子串起点,该子串包含L中的所有元素。
[Leetcode] Substring with Concatenation of All Words
标签:io ar strong for sp div art c on
原文地址:http://www.cnblogs.com/Phoebe815/p/4003278.html