File tree 1 file changed +5
-5
lines changed
src/algorithms/sets/combination-sum
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -15,20 +15,20 @@ function combinationSumRecursive(
15
15
) {
16
16
if ( remainingSum < 0 ) {
17
17
// By adding another candidate we've gone below zero.
18
- // This would mean that last candidate was not acceptable.
18
+ // This would mean that the last candidate was not acceptable.
19
19
return finalCombinations ;
20
20
}
21
21
22
22
if ( remainingSum === 0 ) {
23
- // In case if after adding the previous candidate out remaining sum
24
- // became zero we need to same current combination since it is one
25
- // of the answer we're looking for.
23
+ // If after adding the previous candidate our remaining sum
24
+ // became zero - we need to save the current combination since it is one
25
+ // of the answers we're looking for.
26
26
finalCombinations . push ( currentCombination . slice ( ) ) ;
27
27
28
28
return finalCombinations ;
29
29
}
30
30
31
- // In case if we haven't reached zero yet let's continue to add all
31
+ // If we haven't reached zero yet let's continue to add all
32
32
// possible candidates that are left.
33
33
for ( let candidateIndex = startFrom ; candidateIndex < candidates . length ; candidateIndex += 1 ) {
34
34
const currentCandidate = candidates [ candidateIndex ] ;
You can’t perform that action at this time.
0 commit comments