We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
That will be slower. The extra isPrime() check is much slower then the 3 lines of code in the for loop in isPrime(). You can actually test out both versions and see the execution times in your submissions.
Prime Checker
You are viewing a single comment's thread. Return to all comments →
That will be slower. The extra isPrime() check is much slower then the 3 lines of code in the for loop in isPrime(). You can actually test out both versions and see the execution times in your submissions.
HackerRank solutions.