about summary refs log tree commit diff
path: root/users/sterni/exercises/aoc/2022/06
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2022-12-06T06·15+0100
committerclbot <clbot@tvl.fyi>2022-12-06T14·45+0000
commitefbac0813c6bfb17e6620bc4a8f52eb94812bb92 (patch)
treece51c918224040784601adb4a5ff322a7fc79e9c /users/sterni/exercises/aoc/2022/06
parent3f2172556a8b83abe5b6f760fabae5d766a50a05 (diff)
feat(sterni/aoc/2022): day06 array solutions r/5394
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 <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Autosubmit: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'users/sterni/exercises/aoc/2022/06')
-rw-r--r--users/sterni/exercises/aoc/2022/06/6.bqn4
-rw-r--r--users/sterni/exercises/aoc/2022/06/6.k1
2 files changed, 5 insertions, 0 deletions
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"