From efbac0813c6bfb17e6620bc4a8f52eb94812bb92 Mon Sep 17 00:00:00 2001 From: sterni Date: Tue, 6 Dec 2022 07:15:31 +0100 Subject: feat(sterni/aoc/2022): day06 array solutions Today's problem works very nicely thanks to window although the indexing sadly is off by a constant amount from what we immediately get. I have a feeling someone is going to demolish my 31 char k solution. Change-Id: Ia90786ce2fe321235286a85c466decf7feb669ed Reviewed-on: https://cl.tvl.fyi/c/depot/+/7534 Reviewed-by: sterni Tested-by: BuildkiteCI Autosubmit: sterni --- users/sterni/exercises/aoc/2022/06/6.bqn | 4 ++++ users/sterni/exercises/aoc/2022/06/6.k | 1 + 2 files changed, 5 insertions(+) create mode 100644 users/sterni/exercises/aoc/2022/06/6.bqn create mode 100644 users/sterni/exercises/aoc/2022/06/6.k (limited to 'users/sterni/exercises/aoc/2022') diff --git a/users/sterni/exercises/aoc/2022/06/6.bqn b/users/sterni/exercises/aoc/2022/06/6.bqn new file mode 100644 index 000000000000..041a2e9100d3 --- /dev/null +++ b/users/sterni/exercises/aoc/2022/06/6.bqn @@ -0,0 +1,4 @@ +i ← ⊑•FLines "input" +FirstMarker ← {𝕩+⊑/(∧´∘¬⊒)˘𝕩↕i} +•Out "day06.1: "∾•Fmt FirstMarker 4 +•Out "day06.2: "∾•Fmt FirstMarker 14 diff --git a/users/sterni/exercises/aoc/2022/06/6.k b/users/sterni/exercises/aoc/2022/06/6.k new file mode 100644 index 000000000000..3dc0de0a3e2d --- /dev/null +++ b/users/sterni/exercises/aoc/2022/06/6.k @@ -0,0 +1 @@ +4 14{x+*&x=#'?'x':y}\:1:"input" -- cgit 1.4.1