Sum Multiples asks you to return the sum of every integer from one through a given positive number that is divisible by three, five, or seven, counting each qualifying number once.
Statement
Given a positive integer n, return the sum of all integers in the range [1,n] inclusive that are divisible by 3, 5, or 7.
Constraints:
1≤n≤103
Examples
Fetching Slides...
Understand the problem
Now, let’s take a moment to make sure you’ve correctly understood the problem. The quiz below helps you check if you’re solving the correct problem:
Sum Multiples
1.
What is the output for the input n = 3?
A.
(0)
B.
(3)
C.
(5)
D.
(8)
1 / 3
Figure it out!
We have a game for you to play. Rearrange the logical building blocks to develop a clearer understanding of how to solve this problem.
Sequence - Vertical
Drag and drop the cards to rearrange them in the correct sequence
1
2
3
4
5
Try it yourself
Implement your solution in the following coding playground.
Sum Multiples asks you to return the sum of every integer from one through a given positive number that is divisible by three, five, or seven, counting each qualifying number once.
Statement
Given a positive integer n, return the sum of all integers in the range [1,n] inclusive that are divisible by 3, 5, or 7.
Constraints:
1≤n≤103
Examples
Fetching Slides...
Understand the problem
Now, let’s take a moment to make sure you’ve correctly understood the problem. The quiz below helps you check if you’re solving the correct problem:
Sum Multiples
1.
What is the output for the input n = 3?
A.
(0)
B.
(3)
C.
(5)
D.
(8)
1 / 3
Figure it out!
We have a game for you to play. Rearrange the logical building blocks to develop a clearer understanding of how to solve this problem.
Sequence - Vertical
Drag and drop the cards to rearrange them in the correct sequence
1
2
3
4
5
Try it yourself
Implement your solution in the following coding playground.