setInterval timeout on Project Euler challenges

setInterval timeout on Project Euler challenges
0

#1

I have a question about the Project Euler challenges. I’m on problem 3 (greatest prime factor) and I’ve built an algorithm that works, but the console throws " [Violation] setInteral took x seconds " or “setTimeout took x seconds”. Right now I can get < 100 iterations before timeout (~200ms).

Is this part of the challenge to get my algorithm as efficient as possible? Or just a guard against infinite loops? Is it built into fCC or does my browser do it? Just curious.


#2

It’s both. They of course don’t want inf loops, but they are trying to test your algorithmic skills. Not sure where the test code lies, but it’s probably loaded locally.