Skip to content

Latest commit

 

History

History
27 lines (14 loc) · 1010 Bytes

README.md

File metadata and controls

27 lines (14 loc) · 1010 Bytes

FreeCodeCamp Intermediate Algorithm Scripting

Did you know? On FreeCodeCamp there are 21 intermediate algorithm scripting and lots of other JavaScript challenges. I love it! Test it!

Smallest Common Multiple

Find the smallest common multiple of the provided parameters that can be evenly divided by both, as well as by all sequential numbers in the range between these parameters.

The range will be an array of two numbers that will not necessarily be in numerical order.

For example, if given 1 and 3, find the smallest common multiple of both 1 and 3 that is also evenly divisible by all numbers between 1 and 3. The answer here would be 6.


The Tests:

smallestCommons([1, 5]) should return a number.

smallestCommons([1, 5]) should return 60.

smallestCommons([5, 1]) should return 60.

smallestCommons([2, 10]) should return 2520.

smallestCommons([1, 13]) should return 360360.

smallestCommons([23, 18]) should return 6056820.