Ad
Code
Diff
  • def is_prime(n)
       n.prime?
    end
    • def is_prime(n)
    • return false if n < 2
    • for x in 2.. Math.sqrt(n).round
    • return false if n % x == 0
    • end
    • return true
    • n.prime?
    • end