From 0b2ac3b9f39ed33babf3f00ce517c06c9383200d Mon Sep 17 00:00:00 2001 From: chenshuai <2268380485@qq.com> Date: Thu, 24 Apr 2025 10:31:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=80=A7=E6=8F=90=E4=BA=A4:?= =?UTF-8?q?=E9=99=88=E5=B8=85=E6=8F=90=E4=BA=A45=E8=A1=8C,=E7=9C=8B?= =?UTF-8?q?=E5=A4=B4=E6=AD=8C=E5=8F=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/other/temp.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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