diff --git a/src/other/temp.js b/src/other/temp.js index dae047a..f7ace91 100644 --- a/src/other/temp.js +++ b/src/other/temp.js @@ -19,4 +19,9 @@ function kmpSearch(str, pattern) { return i - j; } return -1; -} \ No newline at end of file +} + +//try to use KMP +var strStr = function(haystack, needle) { + return kmpSearch(haystack, needle); +}; \ No newline at end of file