diff --git a/src/other/temp.js b/src/other/temp.js index ed3c9ed..dae047a 100644 --- a/src/other/temp.js +++ b/src/other/temp.js @@ -15,4 +15,8 @@ function kmpSearch(str, pattern) { } } + if (j === pattern.length) { + return i - j; + } + return -1; } \ No newline at end of file