Movatterモバイル変換


[0]ホーム

URL:


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

Commit5356af7

Browse files
committed
Removed unnecessary code from JS 39
1 parentc708d4a commit5356af7

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

‎javascript/39-Combination-Sum.js‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,9 @@
1212
functioncombinationSum(candidates,target){
1313

1414
candidates.sort((a,b)=>a-b);
15-
1615
constcombos=[];
1716
constcombo=[];
18-
constset=newSet();
19-
20-
for(constcandidateofcandidates){
21-
set.add(candidate);
22-
}
23-
17+
constset=newSet(candidates);
2418
buildCombos(target);
2519
returncombos;
2620

@@ -45,4 +39,4 @@ function combinationSum(candidates, target) {
4539
combo.pop();
4640
}
4741
}
48-
}
42+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp