about summary refs log tree commit diff
path: root/users
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2022-12-27T12·33+0100
committerclbot <clbot@tvl.fyi>2022-12-27T13·35+0000
commita25c60361e290012d5e81d0f8b3911bf494a4ae0 (patch)
tree56a91255eecc8b8edbc1a9ebf0de5bd03f58deff /users
parent7df27dad12e13c3abf3292bd24718df9529475ed (diff)
feat(sterni/aoc/2022): day25 array solutions r/5502
Another approach for figuring out the SNAFU digits in k:
https://github.com/leahneukirchen/adventofcode2022/blob/master/day25.k

Change-Id: Iddf424aff8fcac176109fd35ef44bdd875302adc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7647
Autosubmit: sterni <sternenseemann@systemli.org>
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Diffstat (limited to 'users')
-rw-r--r--users/sterni/exercises/aoc/2022/25/25.bqn4
-rw-r--r--users/sterni/exercises/aoc/2022/25/25.k1
2 files changed, 5 insertions, 0 deletions
diff --git a/users/sterni/exercises/aoc/2022/25/25.bqn b/users/sterni/exercises/aoc/2022/25/25.bqn
new file mode 100644
index 000000000000..921099141f09
--- /dev/null
+++ b/users/sterni/exercises/aoc/2022/25/25.bqn
@@ -0,0 +1,4 @@
+c ← "=-012"
+F ← +´∘(⊢×(5⊸⋆)∘⌽∘↕∘≠)∘(-⟜2)∘(c⊸⊐)
+T ← {c⊏˜5|2+𝕩 {(⌊5÷˜𝕨+2) (𝕊⟜(𝕨⊸∾))⍟(0<𝕨) 𝕩} ⟨⟩}
+•Out "day25.1: "∾T +´F¨ •FLines "input"
diff --git a/users/sterni/exercises/aoc/2022/25/25.k b/users/sterni/exercises/aoc/2022/25/25.k
new file mode 100644
index 000000000000..df956f002f2e
--- /dev/null
+++ b/users/sterni/exercises/aoc/2022/25/25.k
@@ -0,0 +1 @@
+c@2+{(1_o,0)+x+-5*o:2<x}/5\+/{5/x-2}'(c:"=-012")?0:"input"