From 9848440f3ff1e58d02db16330aa6982b2e92329d Mon Sep 17 00:00:00 2001 From: Andrew Ekstedt Date: Tue, 6 Dec 2022 22:19:00 -0800 Subject: [PATCH] day 6 simplify ivy solution and fix an off-by-n bug --- day06/sol.ivy | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/day06/sol.ivy b/day06/sol.ivy index 3801bcd..ec3a4e8 100644 --- a/day06/sol.ivy +++ b/day06/sol.ivy @@ -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