5 kyu
Concatenation substring
70joh_pot
Description:
Write
function findSubstring (s, words) {}
that given a string, s
, and a list of words, words
, that are all of the same length. Find all starting indices of substring in s
that is a concatenation of each word in words
exactly once and without any intervening characters.
For example:
findSubstring("barfoofoobarthefoobarman", ["bar", "foo", "the"]) === [6, 9, 12]
findSubstring("helloworld", ["world", "hello"]) === [0]
findSubstring("helloworld", ["bar", "foo"]) === []
Performance
Algorithms
Similar Kata:
Stats:
Created | Dec 22, 2017 |
Published | Dec 22, 2017 |
Warriors Trained | 904 |
Total Skips | 70 |
Total Code Submissions | 2070 |
Total Times Completed | 70 |
JavaScript Completions | 70 |
Total Stars | 31 |
% of votes with a positive feedback rating | 84% of 22 |
Total "Very Satisfied" Votes | 16 |
Total "Somewhat Satisfied" Votes | 5 |
Total "Not Satisfied" Votes | 1 |
Total Rank Assessments | 5 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 8 kyu |