Merge pull request #1371 from Jerry-306/patch-52
纠正 0131 分割回文串 JavaScript 版本代码
This commit is contained in:
commit
42970ccae0
|
|
@ -442,7 +442,7 @@ var partition = function(s) {
|
||||||
}
|
}
|
||||||
for(let j = i; j < len; j++) {
|
for(let j = i; j < len; j++) {
|
||||||
if(!isPalindrome(s, i, j)) continue;
|
if(!isPalindrome(s, i, j)) continue;
|
||||||
path.push(s.substr(i, j - i + 1));
|
path.push(s.slice(i, j + 1));
|
||||||
backtracking(j + 1);
|
backtracking(j + 1);
|
||||||
path.pop();
|
path.pop();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue