You are given a string s and an array of strings words. All the strings of words are of the same length. Return all starting indices of substring(s) in s that is a concatenation of each word in words exactly once.
Examples
Example 1
Input
s = "barfoothefoobarman", words = ["foo","bar"]
Output
[0,9]
Constraints
1 <= s.length <= 10^4
0 <= words.length <= 5000
1 <= words[i].length <= 30
JavaScript
Loading...
No test cases available for this problem.
Substring with Concatenation of All Words | itrate