about summary refs log tree commit diff
path: root/users/sterni/exercises
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2022-12-02T18·27+0100
committersterni <sternenseemann@systemli.org>2022-12-02T18·31+0000
commitc0e70de17a6637a2018c83429acbeba32583bd1d (patch)
tree9dbe1e2f710713d45827d8a60fa8b658dc8e5f21 /users/sterni/exercises
parent21388ddb85384d9eb9c0fda62d45f98f646cdf03 (diff)
feat(sterni/aoc/2022): day02 solution r/5377
It seems to me that there must be some way to improve this further,
but I'm kind of out of time.

Change-Id: Icf3510b6c126345551125543aec70155b6eeff4e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7498
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Autosubmit: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'users/sterni/exercises')
-rw-r--r--users/sterni/exercises/aoc/2022/02/2.bqn7
1 files changed, 7 insertions, 0 deletions
diff --git a/users/sterni/exercises/aoc/2022/02/2.bqn b/users/sterni/exercises/aoc/2022/02/2.bqn
new file mode 100644
index 000000000000..65e3c817bbd2
--- /dev/null
+++ b/users/sterni/exercises/aoc/2022/02/2.bqn
@@ -0,0 +1,7 @@
+lib ← •Import •path∾"/../../lib.bqn"
+i ← 3|"ABCXYZ"⊸⊐¨ ' ' ⊑¨∘lib.SplitOn¨ •FLines •path∾"/input"
+S1 ← {1+𝕩+3×3|1+𝕩-𝕨}
+S2 ← {𝕨 S1 3|𝕨+𝕩-1}
+
+•Out "day02.1: "∾•Fmt +´S1´¨i
+•Out "day02.2: "∾•Fmt +´S2´¨i