File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/algorithms/sets/combination-sum Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -15,20 +15,20 @@ function combinationSumRecursive(
1515) {
1616 if ( remainingSum < 0 ) {
1717 // 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.
1919 return finalCombinations ;
2020 }
2121
2222 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.
2626 finalCombinations . push ( currentCombination . slice ( ) ) ;
2727
2828 return finalCombinations ;
2929 }
3030
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
3232 // possible candidates that are left.
3333 for ( let candidateIndex = startFrom ; candidateIndex < candidates . length ; candidateIndex += 1 ) {
3434 const currentCandidate = candidates [ candidateIndex ] ;
You can’t perform that action at this time.
0 commit comments