summaryrefslogtreecommitdiff
path: root/problem31.ijs
diff options
context:
space:
mode:
Diffstat (limited to 'problem31.ijs')
-rw-r--r--problem31.ijs10
1 files changed, 10 insertions, 0 deletions
diff --git a/problem31.ijs b/problem31.ijs
new file mode 100644
index 0000000..f26696d
--- /dev/null
+++ b/problem31.ijs
@@ -0,0 +1,10 @@
+pick =. dyad define
+ if. 0=#y do.
+ x=0
+ else.
+ coin =. {. y
+ newCoins =. }. y
+ +/([:pick&newCoins x-coin*])"0 i.>:<.x%coin
+ end.
+)
+problem31 =: 200 pick 200 100 50 20 10 5 2 1