Skip to content

Commit f9e2b2a

Browse files
Merge pull request youngyangyang04#1803 from 5Reasons/master
更新 131.分割回文 串 js代码的变量名,和教程保持一致避免混淆
2 parents ad558b0 + 50aba63 commit f9e2b2a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

problems/0131.分割回文串.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -488,15 +488,15 @@ var partition = function(s) {
488488
const res = [], path = [], len = s.length;
489489
backtracking(0);
490490
return res;
491-
function backtracking(i) {
492-
if(i >= len) {
491+
function backtracking(startIndex) {
492+
if(startIndex >= len) {
493493
res.push(Array.from(path));
494494
return;
495495
}
496-
for(let j = i; j < len; j++) {
497-
if(!isPalindrome(s, i, j)) continue;
498-
path.push(s.slice(i, j + 1));
499-
backtracking(j + 1);
496+
for(let i = startIndex; i < len; i++) {
497+
if(!isPalindrome(s, startIndex, i)) continue;
498+
path.push(s.slice(startIndex, i + 1));
499+
backtracking(i + 1);
500500
path.pop();
501501
}
502502
}

problems/0491.递增子序列.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ var findSubsequences = function(nums) {
399399

400400
```
401401

402-
## TypeScript
402+
### TypeScript
403403

404404
```typescript
405405
function findSubsequences(nums: number[]): number[][] {
@@ -545,7 +545,7 @@ int** findSubsequences(int* nums, int numsSize, int* returnSize, int** returnCol
545545
}
546546
```
547547
548-
## Swift
548+
### Swift
549549
550550
```swift
551551
func findSubsequences(_ nums: [Int]) -> [[Int]] {
@@ -576,7 +576,7 @@ func findSubsequences(_ nums: [Int]) -> [[Int]] {
576576
```
577577

578578

579-
## Scala
579+
### Scala
580580

581581
```scala
582582
object Solution {

0 commit comments

Comments
 (0)