Skip to content

Commit 7c9601d

Browse files
thewizarodofoztrekhleb
authored andcommitted
Update combinationSum.js (trekhleb#137)
fixing a few typos in comments
1 parent 941feda commit 7c9601d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/algorithms/sets/combination-sum/combinationSum.js

+5-5
Original file line numberDiff line numberDiff 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];

0 commit comments

Comments
 (0)