You are viewing a single comment's thread. Return to all comments →
Hi. For your isPrime() function, I see you iterated up to n/2. This gives you a runtime of O(n). Try iterating to square root of n like this for an O(n^(1/2)) runtime.
Hope this helps.