I just finished the “Smallest Common Multiple” problem in the Front-End “Intermediate Algorithm Scripting” section and I’m just wonder, did this problem seem really involved to anyone else? My solution required using 11 different functions and ran almost 150 lines long. This one seemed a lot more intense than any of the previous problems in this section and took me a few hours to solve. Not that I’m complaining about the workload or complexity; I’m just curious if there was an easier way of solving this problem (that isn’t massively resource inefficient). I’ll post a CodePen link to my solution below. Note: I’m using a trick with prime factorization to solve the problem which I’ll post a link to below as well.

My Solution

Trick for Solving LCM Problems Using Prime Factorization