Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b487383

Browse files
纠正 0131 分割回文串 JavaScript 版本代码
String 实例方法 substr 已弃用,请换成 slice
1 parent e07a3ca commit b487383

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎problems/0131.分割回文串.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ var partition = function(s) {
442442
}
443443
for(let j = i; j < len; j++) {
444444
if(!isPalindrome(s, i, j)) continue;
445-
path.push(s.substr(i, j- i + 1));
445+
path.push(s.slice(i, j + 1));
446446
backtracking(j + 1);
447447
path.pop();
448448
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /