Skip to content

Commit

Permalink
Sync sum-of-multiples docs with problem-specifications (#303)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kytrinyx authored Mar 28, 2023
1 parent ec46877 commit 81fca67
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions exercises/practice/sum-of-multiples/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
# Instructions

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

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

The sum of these multiples is 78.
Suppose the limit is 20 and the list of factors is [3, 5].
We need to find the sum of all unique multiples of 3 and 5 that are less than 20.

Multiples of 3 less than 20: 3, 6, 9, 12, 15, 18
Multiples of 5 less than 20: 5, 10, 15

The unique multiples are: 3, 5, 6, 9, 10, 12, 15, 18

The sum of the unique multiples is: 3 + 5 + 6 + 9 + 10 + 12 + 15 + 18 = 78

So, the answer is 78.

0 comments on commit 81fca67

Please sign in to comment.