Smallest Common Multiple | I can run my code on my computer but not in freecodecamp?

Hi,

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

I run my code on my computer, and return 6056820.
But when i run my code in freecodecamp, my code didn’t pass the test.

My code is bad, need more than 5 sec to solve the problem. Is this the reason why it didn’t pass the test?

Because your code takes so long to run, it is running into FCC’s Infinite Loop Protection. This can be turned off, but always do this with extreme caution.

For what it’s worth, this challenge can be solved efficiently enough that the loop protect does not have to be turned off.

1 Like