Prime Checker

  • + 1 comment

    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.

    HackerRank solutions.