We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 881043e + 17dbf72 commit b0244c7Copy full SHA for b0244c7
Is prime?/problem.txt
@@ -0,0 +1,9 @@
1
+Implement a function that determines if a given positive integer is a prime or not.
2
+
3
+Example
4
5
+For n = 47, the output should be
6
+isPrime(n) = true;
7
8
+For n = 4, the output should be
9
+isPrime(n) = false;
Is prime?/solution.hs
@@ -0,0 +1 @@
+isPrime n = length (filter (==0) (map (mod n) [1..n])) == 2
0 commit comments