about summary refs log tree commit diff
path: root/day08.bqn
diff options
context:
space:
mode:
Diffstat (limited to 'day08.bqn')
-rw-r--r--day08.bqn9
1 files changed, 9 insertions, 0 deletions
diff --git a/day08.bqn b/day08.bqn
new file mode 100644
index 0000000..d9f1ac0
--- /dev/null
+++ b/day08.bqn
@@ -0,0 +1,9 @@
+str←•Import"bqn-libs/strings.bqn"
+Dec←(10⊸×+⊣)´∘⌽
+d ← 'a'-˜" "⊸str.Split¨¨ " | "⊸str.Split¨ •FLines"day08"
+
+•Out +´ 2‿3‿4‿7 ∊˜ ≠¨∾1⊑¨d
+
+c ← 'a'-˜"abcefg"‿"cf"‿"acdeg"‿"acdfg"‿"bdcf"‿"abdfg"‿"abdefg"‿"acf"‿"abcdefg"‿"abcdfg"
+P2 ← { ∧∘⊏⟜(+˝(∾𝕨)=⌜↕7)¨𝕩 }
+•Out +´Dec¨((P2˜ c) ⊐ P2´)¨d