Given a positive integer n, return the sum of all integers in the range [1,[1,[1, n]]] inclusive that are divisible by 333, 555, or 777.
n
Constraints:
1≤1 \leq1≤ n ≤103\leq 10^3≤103
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
What is the output for the input n = 3?
n = 3
(0)
(3)
(5)
(8)
We have a game for you to play. Rearrange the logical building blocks to develop a clearer understanding of how to solve this problem.
Implement your solution in the following coding playground.