Skip to content

Commit 92f32c1

Browse files
committed
doc: add notes
1 parent aaba523 commit 92f32c1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

algorithms-and-data-structures/project-euler/001-multiples-of-3-or-5/multiples-of-3-or-5-while-mo.js

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const sumMultsOf3Or5 = (limit) => {
1414
let mult5 = 5
1515
let sum = 0
1616

17+
// Sum multiples of 3 and multiples of 5 that are not multiples of 3.
1718
while (mult5 < limitFloor) {
1819
sum += mult3
1920
if (mult5 % 3 !== 0) sum += mult5 // Avoid counting multiples of both twice
@@ -22,6 +23,7 @@ const sumMultsOf3Or5 = (limit) => {
2223
mult5 += 5
2324
}
2425

26+
// Sum remaining multiples of 3.
2527
while (mult3 < limitFloor) {
2628
sum += mult3
2729
mult3 += 3

0 commit comments

Comments
 (0)