summaryrefslogtreecommitdiff
path: root/problem31.ijs
diff options
context:
space:
mode:
authorPeter Mikkelsen <petermikkelsen10@gmail.com>2021-11-11 19:57:08 +0100
committerPeter Mikkelsen <petermikkelsen10@gmail.com>2021-11-11 19:57:08 +0100
commita59b40cb74f4efd699ca73ec37cef9e9262ffc0b (patch)
tree7d84884845ebbd33447b7c87a6c5e0d72c6adf6a /problem31.ijs
parent87148a396856589ed5b22f02967b5c0eda0f70e2 (diff)
Fix problem 31
Diffstat (limited to 'problem31.ijs')
-rw-r--r--problem31.ijs5
1 files changed, 3 insertions, 2 deletions
diff --git a/problem31.ijs b/problem31.ijs
index f26696d..65a61f0 100644
--- a/problem31.ijs
+++ b/problem31.ijs
@@ -1,4 +1,4 @@
-pick =. dyad define
+pick =: {{
if. 0=#y do.
x=0
else.
@@ -6,5 +6,6 @@ pick =. dyad define
newCoins =. }. y
+/([:pick&newCoins x-coin*])"0 i.>:<.x%coin
end.
-)
+}}
+
problem31 =: 200 pick 200 100 50 20 10 5 2 1