From b4873836bacc8a65b84e8f9a7e8da7fd5d7dcd58 Mon Sep 17 00:00:00 2001 From: Luo <82520819+Jerry-306@users.noreply.github.com> Date: Sat, 21 May 2022 09:45:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=A0=E6=AD=A3=200131=20=E5=88=86=E5=89=B2?= =?UTF-8?q?=E5=9B=9E=E6=96=87=E4=B8=B2=20JavaScript=20=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit String 实例方法 substr 已弃用,请换成 slice --- problems/0131.分割回文串.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problems/0131.分割回文串.md b/problems/0131.分割回文串.md index 7a702898..6a370fb4 100644 --- a/problems/0131.分割回文串.md +++ b/problems/0131.分割回文串.md @@ -442,7 +442,7 @@ var partition = function(s) { } for(let j = i; j < len; j++) { if(!isPalindrome(s, i, j)) continue; - path.push(s.substr(i, j - i + 1)); + path.push(s.slice(i, j + 1)); backtracking(j + 1); path.pop(); }