g***l 发帖数: 352 | 1 题目: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).
为什么[4,12]不满足要求?0,9之间也有别的characters呀? | l*****a 发帖数: 14598 | 2 start from 0: it is bar/foo
start from 9: it is foo/bar
which include all words of L
what is your result?
the
【在 g***l 的大作中提到】 : 题目: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). : 为什么[4,12]不满足要求?0,9之间也有别的characters呀?
| t*****3 发帖数: 112 | 3 你得理解concatenation of each word中concatenation的含义
the
【在 g***l 的大作中提到】 : 题目: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). : 为什么[4,12]不满足要求?0,9之间也有别的characters呀?
| g***l 发帖数: 352 | 4 Thanks. I misunderstood the question.
【在 t*****3 的大作中提到】 : 你得理解concatenation of each word中concatenation的含义 : : the
|
|