about summary refs log tree commit diff
path: root/day03.bqn
diff options
context:
space:
mode:
Diffstat (limited to 'day03.bqn')
-rw-r--r--day03.bqn7
1 files changed, 7 insertions, 0 deletions
diff --git a/day03.bqn b/day03.bqn
new file mode 100644
index 0000000..b68d8e2
--- /dev/null
+++ b/day03.bqn
@@ -0,0 +1,7 @@
+d←'0'-˜•FLines"day03"
+Dec←(2⊸×+⊣)´∘⌽
+
+•Out (2×+´⍉d)(≤×○Dec>)≠d
+
+_part2 ← { 1=≠𝕩 ? ⊑𝕩 ; (𝕨+1) 𝕊 𝕩/˜ =⟜(+´ 𝔽 ÷⟜2∘≠) 𝕨 ⊑¨ 𝕩 }
+•Out (0 ≥_part2 d) ×○Dec (0 <_part2 d)