You are given three parameters: start(int), end(int) and list(of int);
Make a function that returns the amount of times all the numbers between start and end are multiples of the elements in the list. example:
start = 15; end = 18; list = [2, 4, 3];
15 => 1 (is multiple of 3)
16 => 2 (is multiple of 2 and 4)
17 => 0
18 => 2 (is multiple of 2 and 3)
result = 5
The function should accept two positive integer numbers and an array of integers as parameters, returning the total integer number. Assume that start is less <= end.
examples:
Multiple(1, 10, [1, 2]); => 15
Multiple(1, 800, [7, 8]); => 214
Multiple(301, 5000,[13, 5]); => 1301
The shortest solution is the victor!!! May he odds be ever in your favor...
start
will always be less thanend
? \$\endgroup\$ – Galen Ivanov Dec 2 '19 at 11:49start
,end
or the elements inlist
may be non-positive? \$\endgroup\$ – Seb Dec 3 '19 at 11:17