feat(sterni/aoc/2022): day04 BQN solution
Very tired today, but seems like a decently tidy solution. Change-Id: Id3055159ae99e9b91fcc4b9b41ec7fe5e9a1bc6a Reviewed-on: https://cl.tvl.fyi/c/depot/+/7528 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Autosubmit: sterni <sternenseemann@systemli.org>
This commit is contained in:
parent
ee4b95e470
commit
5a41c4c6aa
1 changed files with 11 additions and 0 deletions
11
users/sterni/exercises/aoc/2022/04/4.bqn
Normal file
11
users/sterni/exercises/aoc/2022/04/4.bqn
Normal file
|
@ -0,0 +1,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
|
Loading…
Reference in a new issue