summaryrefslogtreecommitdiff
path: root/problem38.ijs
diff options
context:
space:
mode:
Diffstat (limited to 'problem38.ijs')
-rw-r--r--problem38.ijs7
1 files changed, 7 insertions, 0 deletions
diff --git a/problem38.ijs b/problem38.ijs
new file mode 100644
index 0000000..4f379ea
--- /dev/null
+++ b/problem38.ijs
@@ -0,0 +1,7 @@
+enc =: 10&#.
+digits =: enc^:_1
+cp =: dyad : 'enc ,;digits each x*1+i.y'
+pandigital =: (1+i.9)-:/:~
+cps =: ~.,(i.1e4) cp"0/ 2+i.8
+valid =: pandigital&:digits"0
+problem38 =: x:{.\:~(valid#])cps