about summary refs log tree commit diff
path: root/users/sterni/exercises/aoc/2022/04/4.bqn
blob: 0b8f1b4500a97702624c65557f20712619b1c1cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
⟨SplitOn, ReadDec⟩ ← •Import "../../lib.bqn"

Sections ← {
  a‿b ← ReadDec¨ (<'-') SplitOn 𝕩
  ↕⌾(-⟜a) 1+b
}
i ← ∘‿2⥊Sections¨ ∾(<',') SplitOn¨ •FLines "input"
Is ← ∊´∘((⍋≠¨)⊏⊢)

•Out "day04.1: "∾•Fmt +´(∧´Is)˘ i
•Out "day04.2: "∾•Fmt +´(∨´Is)˘ i