https://oj.leetcode.com/problems/substring-with-concatenation-of-all-words/
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).
'풀어본 Algorithm 문제 정리' 카테고리의 다른 글
[OJ.leetcode] combinations (0) | 2014.08.18 |
---|---|
[OJ.leetcode] sort-colors (1) | 2014.08.17 |
[OJ.leetcode] flatten-binary-tree-to-linked-list (1) | 2014.08.14 |
[OJ.leetcode] jump-game (1) | 2014.08.13 |
[OJ.leetcode] merge-sorted-array (1) | 2014.08.02 |