今天大盘跌了# Stock
g*l
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呀?
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呀?