Ad
  • Custom User Avatar

    Don't know much about ruby, but I'm pretty sure that's how they're converting the numbers to strings.

  • Custom User Avatar

    Your isPrime function fails for 3 (sqrt(3) < 2, creating an invalid range).
    Also, your solution has a worst-case complexity of O(n²); there's a more clever way to do what you're doing without checking all previous primes each time.