@ -15,4 +15,8 @@ function kmpSearch(str, pattern) {
}
if (j === pattern.length) {
return i - j;
return -1;