day 6 simplify ivy solution and fix an off-by-n bug
parent
259fc5cf02
commit
9848440f3f
|
@ -11,13 +11,8 @@ op i loop a =
|
||||||
(i+1) loop a
|
(i+1) loop a
|
||||||
|
|
||||||
op solve n =
|
op solve n =
|
||||||
i = ((1-n) drop iota rho input) o.+ (-1 + iota n)
|
i = iota n
|
||||||
1 loop input[i]
|
(i loop input)[-1]
|
||||||
|
|
||||||
# if we were using rsc's @ patch then we could just do
|
|
||||||
# (unique@ input[i]) iota 1
|
|
||||||
# instead of
|
|
||||||
# i loop input[i]
|
|
||||||
|
|
||||||
solve 4
|
solve 4
|
||||||
solve 14
|
solve 14
|
||||||
|
|
Loading…
Reference in New Issue