day 6 simplify ivy solution and fix an off-by-n bug

main
magical 2022-12-06 22:19:00 -08:00
parent 259fc5cf02
commit 9848440f3f
1 changed files with 2 additions and 7 deletions

View File

@ -11,13 +11,8 @@ op i loop a =
(i+1) loop a
op solve n =
i = ((1-n) drop iota rho input) o.+ (-1 + iota n)
1 loop input[i]
# if we were using rsc's @ patch then we could just do
# (unique@ input[i]) iota 1
# instead of
# i loop input[i]
i = iota n
(i loop input)[-1]
solve 4
solve 14