Skip to content

Commit c7a89f4

Browse files
authored
Sync sum-of-multiples docs with problem-specifications (#1649)
The sum-of-multiples exercise has been improved upstream in the problem-specifications repository. For more context, please see the pull request that updated the exercise: - exercism/problem-specifications#2231
1 parent 83b3d92 commit c7a89f4

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
# Instructions
22

3-
Given a number, find the sum of all the unique multiples of particular numbers up to
4-
but not including that number.
3+
Given a list of factors and a limit, add up all the unique multiples of the factors that are less than the limit.
4+
All inputs will be greater than or equal to zero.
55

6-
If we list all the natural numbers below 20 that are multiples of 3 or 5,
7-
we get 3, 5, 6, 9, 10, 12, 15, and 18.
6+
## Example
87

9-
The sum of these multiples is 78.
8+
Suppose the limit is 20 and the list of factors is [3, 5].
9+
We need to find the sum of all unique multiples of 3 and 5 that are less than 20.
10+
11+
Multiples of 3 less than 20: 3, 6, 9, 12, 15, 18
12+
Multiples of 5 less than 20: 5, 10, 15
13+
14+
The unique multiples are: 3, 5, 6, 9, 10, 12, 15, 18
15+
16+
The sum of the unique multiples is: 3 + 5 + 6 + 9 + 10 + 12 + 15 + 18 = 78
17+
18+
So, the answer is 78.

0 commit comments

Comments
 (0)